From fcb139c9024e6fe6572730ed512e78fc77748688 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 16 Nov 2022 19:04:36 +0000 Subject: [PATCH] fpspreadsheet: Fix LCLScaling of comment marker in grid. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8625 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpspreadsheet/source/visual/fpspreadsheetgrid.pas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas index 21d4bf5da..e838665c7 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas @@ -2761,20 +2761,22 @@ const COMMENT_SIZE = 7; var P: Array[0..3] of TPoint; + commentSize: Integer; begin Canvas.Brush.Color := clRed; Canvas.Brush.Style := bsSolid; Canvas.Pen.Style := psClear; + commentSize := Scale96ToFont(COMMENT_SIZE); if IsRightToLeft then begin P[0] := Point(ARect.Left, ARect.Top); - P[1] := Point(ARect.Left + COMMENT_SIZE, ARect.Top); - P[2] := Point(ARect.Left, ARect.Top + COMMENT_SIZE); + P[1] := Point(ARect.Left + commentSize, ARect.Top); + P[2] := Point(ARect.Left, ARect.Top + commentSize); end else begin P[0] := Point(ARect.Right, ARect.Top); - P[1] := Point(ARect.Right - COMMENT_SIZE, ARect.Top); - P[2] := Point(ARect.Right, ARect.Top + COMMENT_SIZE); + P[1] := Point(ARect.Right - commentSize, ARect.Top); + P[2] := Point(ARect.Right, ARect.Top + commentSize); end; P[3] := P[0]; Canvas.Polygon(P);