You've already forked lazarus-ccr
TvPlanit: Fix clipping of too-large event images.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8896 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -223,14 +223,16 @@ var
|
|||||||
w: Integer;
|
w: Integer;
|
||||||
begin
|
begin
|
||||||
w := 0;
|
w := 0;
|
||||||
if AlarmW <> 0 then inc(w, AlarmW + FScaledIconMargin);
|
if AlarmW <> 0 then
|
||||||
if RecurringW <> 0 then inc(w, RecurringW + FScaledIconMargin);
|
inc(w, AlarmW + FScaledIconMargin);
|
||||||
if CategoryW <> 0 then inc(w, CategoryW + FScaledIconMargin);
|
if RecurringW <> 0 then
|
||||||
if CustomW <> 0 then inc(w, CustomW + FScaledIconMargin);
|
inc(w, RecurringW + FScaledIconMargin);
|
||||||
if w <> 0 then inc(w, FScaledIconMargin);
|
if CategoryW <> 0 then
|
||||||
|
inc(w, CategoryW + FScaledIconMargin);
|
||||||
Result := AEventRect;
|
if CustomW <> 0 then
|
||||||
Result.Right := Result.Left + w;
|
inc(w, CustomW + FScaledIconMargin);
|
||||||
|
if w <> 0 then
|
||||||
|
inc(w, FScaledIconMargin);
|
||||||
|
|
||||||
MaxHeight := AlarmH + FScaledIconMargin;
|
MaxHeight := AlarmH + FScaledIconMargin;
|
||||||
if RecurringH + FScaledIconMargin > MaxHeight then
|
if RecurringH + FScaledIconMargin > MaxHeight then
|
||||||
@ -239,12 +241,12 @@ begin
|
|||||||
MaxHeight := dvBmpCategory.Height;
|
MaxHeight := dvBmpCategory.Height;
|
||||||
if CustomH + FScaledIconMargin > MaxHeight then
|
if CustomH + FScaledIconMargin > MaxHeight then
|
||||||
MaxHeight := dvBmpCustom.Height;
|
MaxHeight := dvBmpCustom.Height;
|
||||||
if MaxHeight > AEventRect.Bottom - AEventRect.Top then
|
if MaxHeight > AEventRect.Bottom - AEventRect.Top - 1 then
|
||||||
MaxHeight := AEventRect.Bottom - AEventRect.Top;
|
MaxHeight := AEventRect.Bottom - AEventRect.Top - 1;
|
||||||
|
|
||||||
Result.Bottom := AEventRect.Top + MaxHeight;
|
Result := AEventRect;
|
||||||
if Result.Right > AEventRect.Right then
|
Result.Bottom := Min(AEventRect.Top + MaxHeight, AEventRect.Bottom);
|
||||||
Result.Right := AEventRect.Right;
|
Result.Right := Min(Result.Left + w, AEventRect.Right);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Returns the imagelist attached to the datastore of the dayview. }
|
{ Returns the imagelist attached to the datastore of the dayview. }
|
||||||
@ -748,6 +750,8 @@ var
|
|||||||
tmpRect: TRect;
|
tmpRect: TRect;
|
||||||
maxW: Integer;
|
maxW: Integer;
|
||||||
grp: TVpResourceGroup;
|
grp: TVpResourceGroup;
|
||||||
|
clipR: TRect;
|
||||||
|
didClip: Boolean;
|
||||||
begin
|
begin
|
||||||
{ Initialize, collect useful information needed later }
|
{ Initialize, collect useful information needed later }
|
||||||
if Assigned(FDayView.Datastore) then
|
if Assigned(FDayView.Datastore) then
|
||||||
@ -887,7 +891,15 @@ begin
|
|||||||
FDayView.OnPrepareEventFont(FDayView, AEvent, RenderCanvas.Font);
|
FDayView.OnPrepareEventFont(FDayView, AEvent, RenderCanvas.Font);
|
||||||
|
|
||||||
if FDayView.IconAttributes.ShowInPrint then
|
if FDayView.IconAttributes.ShowInPrint then
|
||||||
|
begin
|
||||||
|
clipR := RenderCanvas.ClipRect;
|
||||||
|
didClip := RenderCanvas.Clipping;
|
||||||
|
RenderCanvas.ClipRect := EventRect;
|
||||||
|
RenderCanvas.Clipping := true;
|
||||||
DrawIcons(IconRect);
|
DrawIcons(IconRect);
|
||||||
|
RenderCanvas.ClipRect := clipR;
|
||||||
|
RenderCanvas.Clipping := didClip;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Build the event string }
|
{ Build the event string }
|
||||||
EventString := FDayView.BuildEventString(AEvent, false);
|
EventString := FDayView.BuildEventString(AEvent, false);
|
||||||
|
Reference in New Issue
Block a user