From 9f444a7a302abd65341e6a434ca1bebf71009a9c Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 22 Jul 2023 14:34:45 +0000 Subject: [PATCH] TvPlanIt: Minor improvement in wrapped text margins. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8894 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpdayviewpainter.pas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/tvplanit/source/vpdayviewpainter.pas b/components/tvplanit/source/vpdayviewpainter.pas index d912fbf03..20dcc82e2 100644 --- a/components/tvplanit/source/vpdayviewpainter.pas +++ b/components/tvplanit/source/vpdayviewpainter.pas @@ -1106,31 +1106,31 @@ begin if FDayView.WrapStyle = wsIconFlow then begin {$IFDEF REGION_SUPPORT} - WorkRegion1 := CreateRectRgn(AIconRect.Right, AEventRect.Top, AEventRect.Right, AIconRect.Bottom); + WorkRegion1 := CreateRectRgn(AIconRect.Right + FScaledTextMargin, AEventRect.Top, AEventRect.Right, AIconRect.Bottom); WorkRegion2 := CreateRectRgn(AEventRect.Left + FScaledGutterWidth, AIconRect.Bottom, AEventRect.Right, AEventRect.Bottom); TextRegion := CreateRectRgn(AIconRect.Right, AEventRect.Top, AEventRect.Right, AIconRect.Bottom); CombineRgn(TextRegion, WorkRegion1, WorkRegion2, RGN_OR); {$ELSE} SetLength(TextRects, 2); - TextRects[0] := Rect(AIconRect.Right, AEventRect.Top, AEventRect.Right, AIconRect.Bottom); + TextRects[0] := Rect(AIconRect.Right + FScaledTextMargin, AEventRect.Top, AEventRect.Right, AIconRect.Bottom); TextRects[1] := Rect(AEventRect.Left + FScaledGutterWidth, AIconRect.Bottom, AEventRect.Right, AEventRect.Bottom); {$ENDIF} end else begin {$IFDEF REGION_SUPPORT} - TextRegion := CreateRectRgn(AIconRect.Right, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); + TextRegion := CreateRectRgn(AIconRect.Right + FScaledTextMargin, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); {$ELSE} SetLength(TextRects, 1); - TextRects[0] := Rect(AIconRect.Right, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); + TextRects[0] := Rect(AIconRect.Right + FScaledTextMargin, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); {$ENDIF} end; end else begin {$IFDEF REGION_SUPPORT} - TextRegion := CreateRectRgn(AIconRect.Right + FScaledGutterWidth, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); + TextRegion := CreateRectRgn(AIconRect.Right + FScaledTextmargin, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); {$ELSE} SetLength(TextRects, 1); - TextRects[0] := Rect(AIconRect.Right + FScaledGutterWidth, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); + TextRects[0] := Rect(AIconRect.Right + FScaledTextMargin, AEventRect.Top, AEventRect.Right, AEventRect.Bottom); {$ENDIF} end; @@ -1167,7 +1167,7 @@ begin TPSTextOut(RenderCanvas, // wp: both cases are the same ?! Angle, RenderIn, - AIconRect.Right + FScaledGutterWidth + FScaledTextMargin, + AIconRect.Right + FScaledTextMargin, AEventRect.Top + FScaledTextMargin, AText )