Skip to content

Commit de67a00

Browse files
committed
1 parent 8f3128e commit de67a00

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

atsynedit/atsynedit.pas

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,8 @@ TATSynEdit = class(TCustomControl)
13811381
procedure DoPaintGutterFolding(C: TCanvas;
13821382
AWrapItemIndex, AFoldRangeWithCaret: integer;
13831383
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);
13851386
procedure DoPaintGutterBandBG(C: TCanvas; AColor: TColor; AX1, AY1, AX2,
13861387
AY2: integer; AEntireHeight: boolean);
13871388
procedure DoPaintLockedWarning(C: TCanvas);
@@ -4780,7 +4781,7 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
47804781
WrapItem: TATWrapItem;
47814782
LineState: TATLineState;
47824783
GutterItem: TATGutterItem;
4783-
bLineWithCaret, bHandled: boolean;
4784+
bLineWithCaret, bHandled, bIconPainted: boolean;
47844785
NLinesIndex, NBandDecor, NBookmarkIndex: integer;
47854786
TempRect: TRect;
47864787
begin
@@ -4789,6 +4790,7 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
47894790
NLinesIndex:= WrapItem.NLineIndex;
47904791
if not St.IsIndexValid(NLinesIndex) then exit;
47914792
bLineWithCaret:= IsLineWithCaret(NLinesIndex);
4793+
bIconPainted:= false;
47924794

47934795
Inc(ARect.Top, FTextOffsetFromTop);
47944796

@@ -4832,7 +4834,9 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
48324834
ARect.Top,
48334835
GutterItem.Right,
48344836
ARect.Bottom
4835-
));
4837+
),
4838+
bIconPainted
4839+
);
48364840

48374841
//gutter band: bookmark
48384842
GutterItem:= FGutter[FGutterBandBookmarks];
@@ -4848,6 +4852,13 @@ procedure TATSynEdit.DoPaintGutterOfLine(C: TCanvas;
48484852
GutterItem.Right,
48494853
ARect.Bottom
48504854
);
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+
48514862
bHandled:= false;
48524863
DoEventDrawBookmarkIcon(
48534864
C,
@@ -9665,7 +9676,8 @@ procedure TATSynEdit.DoPaintGutterFolding(C: TCanvas;
96659676
C.Pen.Width:= OldPenWidth;
96669677
end;
96679678

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);
96699681
//
96709682
procedure PaintDecorItem(var Decor: TATGutterDecorItem);
96719683
var
@@ -9739,20 +9751,25 @@ procedure TATSynEdit.DoPaintGutterDecor(C: TCanvas; ALine: integer; const ARect:
97399751
Decor: PATGutterDecorItem;
97409752
NItem: integer;
97419753
begin
9754+
AIconPainted:= false;
97429755
if FGutterDecor=nil then exit;
97439756
NItem:= FGutterDecor.Find(ALine);
97449757
if NItem<0 then exit;
97459758

97469759
//paint first found item
97479760
Decor:= FGutterDecor.ItemPtr(NItem);
97489761
PaintDecorItem(Decor^);
9762+
AIconPainted:= not Decor^.IsBackgroundFill;
97499763

97509764
//paint next item, if first one is background-filler
97519765
if Decor^.IsBackgroundFill and FGutterDecor.IsIndexValid(NItem+1) then
97529766
begin
97539767
Decor:= FGutterDecor.ItemPtr(NItem+1);
97549768
if Decor^.Data.LineNum=ALine then
9769+
begin
97559770
PaintDecorItem(Decor^);
9771+
AIconPainted:= true;
9772+
end;
97569773
end;
97579774
end;
97589775

0 commit comments

Comments
 (0)