From fa35718574cc2948df60e1daf978eb665bdedd0e Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 12 Mar 2003 14:39:29 +0000 Subject: [PATCH] fixed clipping origin in stretchblt git-svn-id: trunk@3916 - --- lcl/include/bitmap.inc | 7 +++++-- lcl/include/image.inc | 15 ++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lcl/include/bitmap.inc b/lcl/include/bitmap.inc index a426ac107f..3728dbd7de 100644 --- a/lcl/include/bitmap.inc +++ b/lcl/include/bitmap.inc @@ -36,10 +36,10 @@ begin inherited; end; -procedure TBitmap.Draw(ACanvas: TCanvas; const Rect: TRect); +procedure TBitmap.Draw(ACanvas: TCanvas; const ARect: TRect); begin HandleNeeded; - ACanvas.CopyRect(Rect, Self.Canvas, Classes.Rect(0, 0, Width, Height)); + ACanvas.CopyRect(ARect, Self.Canvas, Rect(0, 0, Width, Height)); end; constructor TBitmap.VirtualCreate; @@ -528,6 +528,9 @@ end; { ============================================================================= $Log$ + Revision 1.28 2003/03/12 14:39:29 mattias + fixed clipping origin in stretchblt + Revision 1.27 2003/03/11 07:46:43 mattias more localization for gtk- and win32-interface and lcl diff --git a/lcl/include/image.inc b/lcl/include/image.inc index 8bf7d4197b..8853ee4263 100644 --- a/lcl/include/image.inc +++ b/lcl/include/image.inc @@ -40,6 +40,7 @@ end; procedure TImage.SetPicture(const AValue: TPicture); begin + if FPicture=AValue then exit; FPicture.Assign(AValue); //the onchange of the picture gets called and notifies that something changed. end; @@ -63,18 +64,21 @@ end; procedure TImage.SetStretch(Value : Boolean); begin + if FStretch=Value then exit; FStretch := Value; PictureChanged(Self); end; procedure TImage.SetTransparent(Value : Boolean); begin + if FTransparent=Value then exit; FTransparent := Value; PictureChanged(Self); end; procedure TImage.SetCenter(Value : Boolean); begin + if FCenter=Value then exit; FCenter := Value; PictureChanged(Self); end; @@ -118,12 +122,13 @@ begin exit; If Stretch then iRect := Rect(0, 0, Width + 1, Height + 1) - else + else begin iRect := Rect(0,0, Picture.Width, Picture.Height); - If Center then - OffsetRect(iRect, - (Width + 1) div 2 - (iRect.Right - iRect.Left) div 2, - (Height + 1) div 2 - (iRect.Bottom -iRect.Top) div 2); + If Center then + OffsetRect(iRect, + (Width + 1) div 2 - (iRect.Right - iRect.Left) div 2, + (Height + 1) div 2 - (iRect.Bottom -iRect.Top) div 2); + end; If Picture.Graphic.Transparent and not Transparent then begin If Picture.Graphic is TBitmap then