Skip to content

Commit

Permalink
prev fix must be cross platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Apr 23, 2020
1 parent 4a727d1 commit db1d49e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions atsynedit/atsynedit_canvasproc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,14 @@ procedure CanvasTextOut(C: TCanvas; APosX, APosY: integer; AText: atString;
APosX+PixOffset2,
APosY+AProps.CharSize.Y);

//increase rect to avoid clipping of italic font at line end,
//eg comment //WWW, if theme has italic comments style,
//with font eg "Fira Code Retina"
if PartPtr^.FontItalic then
Inc(PartRect.Right,
C.Font.Size * OptItalicFontLongerInPercents div 100
);

{$ifdef windows}
BufW:= SRemoveHexDisplayedChars(PartStr);
bAllowLigatures:=
Expand All @@ -652,14 +660,6 @@ procedure CanvasTextOut(C: TCanvas; APosX, APosY: integer; AText: atString;
else
DxPointer:= nil;

//increase rect to avoid clipping of italic font at line end,
//eg comment //WWW, if theme has italic comments style,
//with font eg "Fira Code Retina"
if PartPtr^.FontItalic then
Inc(PartRect.Right,
C.Font.Size * OptItalicFontLongerInPercents div 100
);

_TextOut_Windows(C.Handle,
APosX+PixOffset1,
APosY+AProps.TextOffsetFromLine,
Expand Down

0 comments on commit db1d49e

Please sign in to comment.