mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 08:51:17 +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;
|
FMarkupManager: TSynEditMarkupManager;
|
||||||
|
|
||||||
FCharWidths, FCharWidths2: TPhysicalCharWidths;
|
FCharWidths, FCharWidths2: TPhysicalCharWidths;
|
||||||
|
FCharWidthsFromConverter: Boolean;
|
||||||
FCharWidthsLen: Integer;
|
FCharWidthsLen: Integer;
|
||||||
FCurTxtLineIdx : Integer;
|
FCurTxtLineIdx : Integer;
|
||||||
FCurLineByteLen: Integer;
|
FCurLineByteLen: Integer;
|
||||||
@ -315,6 +316,7 @@ procedure TLazSynPaintTokenBreaker.Finish;
|
|||||||
begin
|
begin
|
||||||
FCharWidths := nil;
|
FCharWidths := nil;
|
||||||
FCharWidths2 := nil;
|
FCharWidths2 := nil;
|
||||||
|
FCharWidthsFromConverter := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLazSynPaintTokenBreaker.SetHighlighterTokensLine(ALine: TLineIdx; out
|
procedure TLazSynPaintTokenBreaker.SetHighlighterTokensLine(ALine: TLineIdx; out
|
||||||
@ -324,14 +326,18 @@ var
|
|||||||
begin
|
begin
|
||||||
FDisplayView.SetHighlighterTokensLine(ALine, ARealLine, LogLeftPos, FCurLineByteLen);
|
FDisplayView.SetHighlighterTokensLine(ALine, ARealLine, LogLeftPos, FCurLineByteLen);
|
||||||
if FLinesView.LogPhysConvertor.CurrentLine = ARealLine then begin
|
if FLinesView.LogPhysConvertor.CurrentLine = ARealLine then begin
|
||||||
FCharWidths2 := FCharWidths;
|
if not FCharWidthsFromConverter then begin
|
||||||
|
FCharWidthsFromConverter := True;
|
||||||
|
FCharWidths2 := FCharWidths;
|
||||||
|
end;
|
||||||
FCharWidths :=FLinesView.LogPhysConvertor.CurrentWidthsDirect;
|
FCharWidths :=FLinesView.LogPhysConvertor.CurrentWidthsDirect;
|
||||||
FCharWidthsLen :=FLinesView.LogPhysConvertor.CurrentWidthsCount;
|
FCharWidthsLen :=FLinesView.LogPhysConvertor.CurrentWidthsCount;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if FCharWidths2 <> nil then begin
|
if FCharWidthsFromConverter then begin
|
||||||
FCharWidths := FCharWidths2;
|
FCharWidths := FCharWidths2;
|
||||||
FCharWidths2 := nil;
|
FCharWidths2 := nil;
|
||||||
|
FCharWidthsFromConverter := False;
|
||||||
end;
|
end;
|
||||||
FLinesView.GetPhysicalCharWidths(ARealLine, FCharWidths, FCharWidthsLen);
|
FLinesView.GetPhysicalCharWidths(ARealLine, FCharWidths, FCharWidthsLen);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user