Skip to content

Commit

Permalink
optim: truncate too long str on rendeding
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Feb 27, 2020
1 parent bc5810c commit 14dd2ea
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions atsynedit/atsynedit_canvasproc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,9 @@ procedure CanvasTextOut(C: TCanvas; APosX, APosY: integer; AText: atString;
ListInt[i]:= ListOffsets[i] * NCharWidth div 100;

//truncate AText, to not paint over screen
for i:= 1 to High(ListInt) do
if ListInt[i]>AProps.ControlWidth then
begin
SetLength(AText, i);
Break;
end;
i:= AProps.ControlWidth div AProps.CharSize.X + 2;
if Length(AText)>i then
SetLength(AText, i);

Dx[0]:= ListInt[0];
for i:= 1 to High(ListInt) do
Expand Down

0 comments on commit 14dd2ea

Please sign in to comment.