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
This commit is contained in:
wp_xxyyzz
2023-07-22 14:34:45 +00:00
parent b211e27180
commit 9f444a7a30

View File

@ -1106,31 +1106,31 @@ begin
if FDayView.WrapStyle = wsIconFlow then if FDayView.WrapStyle = wsIconFlow then
begin begin
{$IFDEF REGION_SUPPORT} {$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); WorkRegion2 := CreateRectRgn(AEventRect.Left + FScaledGutterWidth, AIconRect.Bottom, AEventRect.Right, AEventRect.Bottom);
TextRegion := CreateRectRgn(AIconRect.Right, AEventRect.Top, AEventRect.Right, AIconRect.Bottom); TextRegion := CreateRectRgn(AIconRect.Right, AEventRect.Top, AEventRect.Right, AIconRect.Bottom);
CombineRgn(TextRegion, WorkRegion1, WorkRegion2, RGN_OR); CombineRgn(TextRegion, WorkRegion1, WorkRegion2, RGN_OR);
{$ELSE} {$ELSE}
SetLength(TextRects, 2); 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); TextRects[1] := Rect(AEventRect.Left + FScaledGutterWidth, AIconRect.Bottom, AEventRect.Right, AEventRect.Bottom);
{$ENDIF} {$ENDIF}
end else end else
begin begin
{$IFDEF REGION_SUPPORT} {$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} {$ELSE}
SetLength(TextRects, 1); 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} {$ENDIF}
end; end;
end else end else
begin begin
{$IFDEF REGION_SUPPORT} {$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} {$ELSE}
SetLength(TextRects, 1); 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} {$ENDIF}
end; end;
@ -1167,7 +1167,7 @@ begin
TPSTextOut(RenderCanvas, // wp: both cases are the same ?! TPSTextOut(RenderCanvas, // wp: both cases are the same ?!
Angle, Angle,
RenderIn, RenderIn,
AIconRect.Right + FScaledGutterWidth + FScaledTextMargin, AIconRect.Right + FScaledTextMargin,
AEventRect.Top + FScaledTextMargin, AEventRect.Top + FScaledTextMargin,
AText AText
) )