From be2ce843f9813e430c83fceba8d3eb6cf2fc1a51 Mon Sep 17 00:00:00 2001 From: iadcode Date: Thu, 9 Dec 2021 13:31:29 +1100 Subject: [PATCH 1/2] Fix text bounding rectangle check --- SynPdf.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SynPdf.pas b/SynPdf.pas index 312c70c93..08e049ca3 100644 --- a/SynPdf.pas +++ b/SynPdf.pas @@ -10421,7 +10421,7 @@ procedure DrawLine(var P: TPoint; aH: Single); if AUseDX then begin DX := pointer(PtrUInt(@R)+R.emrtext.offDx); W := DXTextWidth(DX, R.emrText.nChars); - if W Date: Wed, 8 Dec 2021 14:43:09 +1100 Subject: [PATCH 2/2] Fix text underline/strikethrough bug --- SynPdf.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SynPdf.pas b/SynPdf.pas index 08e049ca3..d75236c4f 100644 --- a/SynPdf.pas +++ b/SynPdf.pas @@ -10350,7 +10350,7 @@ procedure DrawLine(var P: TPoint; aH: Single); with DC[nDC] do begin tmp := Pen; pen.color := font.color; - pen.width := aSize / 15 / Canvas.GetWorldFactorX / Canvas.FDevScaleX; + pen.width := aSize / 15 / fscaleY; pen.style := PS_SOLID; pen.null := False; NeedPen; @@ -10607,9 +10607,9 @@ procedure DrawLine(var P: TPoint; aH: Single); end; // handle underline or strike out styles (direct draw PDF lines on canvas) if font.LogFont.lfUnderline<>0 then - DrawLine(Posi, aSize / 8 / Canvas.GetWorldFactorX / Canvas.FDevScaleX); + DrawLine(Posi, aSize / 8 / fscaleY); if font.LogFont.lfStrikeOut<>0 then - DrawLine(Posi, - aSize / 3 / Canvas.GetWorldFactorX / Canvas.FDevScaleX); + DrawLine(Posi, - aSize / 4 / fscaleY); // end any pending clipped TextRect() region if WithClip then begin Canvas.GRestore;