From b6a839a0f78d9d045ab3f3084f89c6a3567165e5 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 19 Mar 2016 22:57:46 +0000 Subject: [PATCH] fpspreadsheet: Fix automatic row height calculation in WorksheetGrid for rotated text. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4578 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpsvisualutils.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/fpspreadsheet/fpsvisualutils.pas b/components/fpspreadsheet/fpsvisualutils.pas index e105f6ce4..ac3093be5 100644 --- a/components/fpspreadsheet/fpsvisualutils.pas +++ b/components/fpspreadsheet/fpsvisualutils.pas @@ -627,7 +627,10 @@ end; function TsTextPainter.GetHeight: Integer; begin - Result := FTotalHeight; + if FTextRotation = trHorizontal then + Result := FTotalHeight + else + Result := FMaxLineLen; end; function TsTextPainter.GetTextPt(x,y,ALineHeight: Integer): TPoint; @@ -656,7 +659,9 @@ end; function TsTextPainter.GetWidth: Integer; begin - Result := FMaxLineLen; + if FTextRotation = trHorizontal then + Result := FMaxLineLen else + Result := FTotalHeight; end; { Called before analyzing and rendering of the text.