mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 19:52:26 +02:00
SynGutter: reduce invalidating/painting
This commit is contained in:
parent
49f44c8ee1
commit
308396194c
@ -831,8 +831,9 @@ begin
|
|||||||
|
|
||||||
FFirstInvalidLine := -1;
|
FFirstInvalidLine := -1;
|
||||||
|
|
||||||
SynEdit.InvalidateGutterLines(ToPos(FInnerFoldStart), ToPos(FInnerFoldEnd));
|
|
||||||
if lvl = 0 then begin
|
if lvl = 0 then begin
|
||||||
|
if FInnerFoldStart >= 0 then
|
||||||
|
SynEdit.InvalidateGutterLines(ToPos(FInnerFoldStart), ToPos(FInnerFoldEnd));
|
||||||
FInnerFoldStart := -1;
|
FInnerFoldStart := -1;
|
||||||
FInnerFoldEnd := -1;
|
FInnerFoldEnd := -1;
|
||||||
exit;
|
exit;
|
||||||
@ -844,7 +845,13 @@ begin
|
|||||||
while (y2 > 0) and (hl.FoldBlockMinLevel(y2, 1) >= lvl) do
|
while (y2 > 0) and (hl.FoldBlockMinLevel(y2, 1) >= lvl) do
|
||||||
dec(y2);
|
dec(y2);
|
||||||
end;
|
end;
|
||||||
|
if FInnerFoldStart <> y2 then begin
|
||||||
|
if y2 > FInnerFoldStart then
|
||||||
|
SynEdit.InvalidateGutterLines(ToPos(FInnerFoldStart), ToPos(y2))
|
||||||
|
else
|
||||||
|
SynEdit.InvalidateGutterLines(ToPos(y2), ToPos(FInnerFoldStart));
|
||||||
FInnerFoldStart := y2;
|
FInnerFoldStart := y2;
|
||||||
|
end;
|
||||||
|
|
||||||
y2 := y;
|
y2 := y;
|
||||||
c := SynEdit.Lines.Count-1;
|
c := SynEdit.Lines.Count-1;
|
||||||
@ -853,10 +860,13 @@ begin
|
|||||||
while (y2 < c) and (hl.FoldBlockMinLevel(y2, 1) >= lvl) do
|
while (y2 < c) and (hl.FoldBlockMinLevel(y2, 1) >= lvl) do
|
||||||
inc(y2);
|
inc(y2);
|
||||||
end;
|
end;
|
||||||
|
if FInnerFoldEnd <> y2 then begin
|
||||||
|
if y2 > FInnerFoldEnd then
|
||||||
|
SynEdit.InvalidateGutterLines(ToPos(FInnerFoldEnd), ToPos(y2))
|
||||||
|
else
|
||||||
|
SynEdit.InvalidateGutterLines(ToPos(y2), ToPos(FInnerFoldEnd));
|
||||||
FInnerFoldEnd := y2;
|
FInnerFoldEnd := y2;
|
||||||
|
end;
|
||||||
SynEdit.InvalidateGutterLines(ToPos(FInnerFoldStart), ToPos(FInnerFoldEnd));
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynGutterCodeFolding.PreferedWidth: Integer;
|
function TSynGutterCodeFolding.PreferedWidth: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user