From cd94f9e48e36684886e502cf76b967bceee9ecb4 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 26 Jan 2016 12:07:56 +0000 Subject: [PATCH] fpspreadsheet: Fix position of comment marker triangle in WorksheetGrid for RTL git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4475 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpspreadsheetgrid.pas | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/components/fpspreadsheet/fpspreadsheetgrid.pas b/components/fpspreadsheet/fpspreadsheetgrid.pas index a55c6677f..15e2bd21b 100644 --- a/components/fpspreadsheet/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/fpspreadsheetgrid.pas @@ -1846,7 +1846,7 @@ const else if (ADrawDirection in [drawDiagUp, drawDiagDown]) then begin dec(ARect.Right, 1); - dec(ARect.Bottom, 1); + dec(ARect.Bottom, 2); end; end; @@ -1984,9 +1984,17 @@ begin Canvas.Brush.Color := clRed; Canvas.Brush.Style := bsSolid; Canvas.Pen.Style := psClear; - 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); + 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); + 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); + end; P[3] := P[0]; Canvas.Polygon(P); end;