@@ -1381,7 +1381,8 @@ TATSynEdit = class(TCustomControl)
1381
1381
procedure DoPaintGutterFolding (C: TCanvas;
1382
1382
AWrapItemIndex, AFoldRangeWithCaret: integer;
1383
1383
ACoord1, ACoord2: TPoint);
1384
- procedure DoPaintGutterDecor (C: TCanvas; ALine: integer; const ARect: TRect);
1384
+ procedure DoPaintGutterDecor (C: TCanvas; ALine: integer; const ARect: TRect;
1385
+ out AIconPainted: boolean);
1385
1386
procedure DoPaintGutterBandBG (C: TCanvas; AColor: TColor; AX1, AY1, AX2,
1386
1387
AY2: integer; AEntireHeight: boolean);
1387
1388
procedure DoPaintLockedWarning (C: TCanvas);
@@ -4780,7 +4781,7 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
4780
4781
WrapItem: TATWrapItem;
4781
4782
LineState: TATLineState;
4782
4783
GutterItem: TATGutterItem;
4783
- bLineWithCaret, bHandled: boolean;
4784
+ bLineWithCaret, bHandled, bIconPainted : boolean;
4784
4785
NLinesIndex, NBandDecor, NBookmarkIndex: integer;
4785
4786
TempRect: TRect;
4786
4787
begin
@@ -4789,6 +4790,7 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
4789
4790
NLinesIndex:= WrapItem.NLineIndex;
4790
4791
if not St.IsIndexValid(NLinesIndex) then exit;
4791
4792
bLineWithCaret:= IsLineWithCaret(NLinesIndex);
4793
+ bIconPainted:= false;
4792
4794
4793
4795
Inc(ARect.Top, FTextOffsetFromTop);
4794
4796
@@ -4832,7 +4834,9 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
4832
4834
ARect.Top,
4833
4835
GutterItem.Right,
4834
4836
ARect.Bottom
4835
- ));
4837
+ ),
4838
+ bIconPainted
4839
+ );
4836
4840
4837
4841
// gutter band: bookmark
4838
4842
GutterItem:= FGutter[FGutterBandBookmarks];
@@ -4848,6 +4852,13 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
4848
4852
GutterItem.Right,
4849
4853
ARect.Bottom
4850
4854
);
4855
+
4856
+ if bIconPainted then
4857
+ begin
4858
+ Inc(TempRect.Left, ImagesGutterDecor.Width div 2 );
4859
+ Inc(TempRect.Right, ImagesGutterDecor.Width div 2 );
4860
+ end ;
4861
+
4851
4862
bHandled:= false;
4852
4863
DoEventDrawBookmarkIcon(
4853
4864
C,
@@ -9665,7 +9676,8 @@ procedure TATSynEdit.DoPaintGutterFolding(C: TCanvas;
9665
9676
C.Pen.Width:= OldPenWidth;
9666
9677
end ;
9667
9678
9668
- procedure TATSynEdit.DoPaintGutterDecor (C: TCanvas; ALine: integer; const ARect: TRect);
9679
+ procedure TATSynEdit.DoPaintGutterDecor (C: TCanvas; ALine: integer; const ARect: TRect;
9680
+ out AIconPainted: boolean);
9669
9681
//
9670
9682
procedure PaintDecorItem (var Decor: TATGutterDecorItem);
9671
9683
var
@@ -9739,20 +9751,25 @@ procedure TATSynEdit.DoPaintGutterDecor(C: TCanvas; ALine: integer; const ARect:
9739
9751
Decor: PATGutterDecorItem;
9740
9752
NItem: integer;
9741
9753
begin
9754
+ AIconPainted:= false;
9742
9755
if FGutterDecor=nil then exit;
9743
9756
NItem:= FGutterDecor.Find(ALine);
9744
9757
if NItem<0 then exit;
9745
9758
9746
9759
// paint first found item
9747
9760
Decor:= FGutterDecor.ItemPtr(NItem);
9748
9761
PaintDecorItem(Decor^);
9762
+ AIconPainted:= not Decor^.IsBackgroundFill;
9749
9763
9750
9764
// paint next item, if first one is background-filler
9751
9765
if Decor^.IsBackgroundFill and FGutterDecor.IsIndexValid(NItem+1 ) then
9752
9766
begin
9753
9767
Decor:= FGutterDecor.ItemPtr(NItem+1 );
9754
9768
if Decor^.Data.LineNum=ALine then
9769
+ begin
9755
9770
PaintDecorItem(Decor^);
9771
+ AIconPainted:= true;
9772
+ end ;
9756
9773
end ;
9757
9774
end ;
9758
9775
0 commit comments