mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 00:09:15 +02:00
SynEdit: fix charwidths issue in paint. Broken in fad67e71ec
Issue #40716
This commit is contained in:
parent
149d8b2306
commit
8bbcf591cf
@ -55,6 +55,7 @@ type
|
||||
FMarkupManager: TSynEditMarkupManager;
|
||||
|
||||
FCharWidths, FCharWidths2: TPhysicalCharWidths;
|
||||
FCharWidthsFromConverter: Boolean;
|
||||
FCharWidthsLen: Integer;
|
||||
FCurTxtLineIdx : Integer;
|
||||
FCurLineByteLen: Integer;
|
||||
@ -315,6 +316,7 @@ procedure TLazSynPaintTokenBreaker.Finish;
|
||||
begin
|
||||
FCharWidths := nil;
|
||||
FCharWidths2 := nil;
|
||||
FCharWidthsFromConverter := False;
|
||||
end;
|
||||
|
||||
procedure TLazSynPaintTokenBreaker.SetHighlighterTokensLine(ALine: TLineIdx; out
|
||||
@ -324,14 +326,18 @@ var
|
||||
begin
|
||||
FDisplayView.SetHighlighterTokensLine(ALine, ARealLine, LogLeftPos, FCurLineByteLen);
|
||||
if FLinesView.LogPhysConvertor.CurrentLine = ARealLine then begin
|
||||
FCharWidths2 := FCharWidths;
|
||||
if not FCharWidthsFromConverter then begin
|
||||
FCharWidthsFromConverter := True;
|
||||
FCharWidths2 := FCharWidths;
|
||||
end;
|
||||
FCharWidths :=FLinesView.LogPhysConvertor.CurrentWidthsDirect;
|
||||
FCharWidthsLen :=FLinesView.LogPhysConvertor.CurrentWidthsCount;
|
||||
end
|
||||
else begin
|
||||
if FCharWidths2 <> nil then begin
|
||||
if FCharWidthsFromConverter then begin
|
||||
FCharWidths := FCharWidths2;
|
||||
FCharWidths2 := nil;
|
||||
FCharWidthsFromConverter := False;
|
||||
end;
|
||||
FLinesView.GetPhysicalCharWidths(ARealLine, FCharWidths, FCharWidthsLen);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user