diff --git a/atsynedit/atsynedit_canvasproc.pas b/atsynedit/atsynedit_canvasproc.pas index 7a77c68ea..f9b0486e4 100644 --- a/atsynedit/atsynedit_canvasproc.pas +++ b/atsynedit/atsynedit_canvasproc.pas @@ -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:= @@ -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,