mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 09:39:07 +02:00
lcl: TCustomImage.Paint: do not invalidate when initializing the image during paint
git-svn-id: trunk@46758 -
This commit is contained in:
parent
5e6a4176d3
commit
4b679593c8
@ -480,6 +480,7 @@ type
|
||||
FTransparent: Boolean;
|
||||
FStretch: Boolean;
|
||||
FUseAncestorCanvas: boolean;
|
||||
FPainting: boolean;
|
||||
function GetCanvas: TCanvas;
|
||||
procedure SetAntialiasingMode(AValue: TAntialiasingMode);
|
||||
procedure SetPicture(const AValue: TPicture);
|
||||
@ -500,6 +501,7 @@ type
|
||||
destructor Destroy; override;
|
||||
property Canvas: TCanvas read GetCanvas;
|
||||
function DestRect: TRect; virtual;
|
||||
procedure Invalidate; override;
|
||||
public
|
||||
property AntialiasingMode: TAntialiasingMode read FAntialiasingMode write SetAntialiasingMode default amDontCare;
|
||||
property Align;
|
||||
|
@ -163,6 +163,12 @@ begin
|
||||
OffsetRect(Result,(ImgWidth-PicWidth) div 2,(ImgHeight-PicHeight) div 2);
|
||||
end;
|
||||
|
||||
procedure TCustomImage.Invalidate;
|
||||
begin
|
||||
if FPainting then exit;
|
||||
inherited Invalidate;
|
||||
end;
|
||||
|
||||
procedure TCustomImage.CalculatePreferredSize(var PreferredWidth,
|
||||
PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||
begin
|
||||
@ -208,7 +214,12 @@ begin
|
||||
C := inherited Canvas;
|
||||
R := DestRect;
|
||||
C.AntialiasingMode := FAntialiasingMode;
|
||||
C.StretchDraw(R, Picture.Graphic);
|
||||
FPainting:=true;
|
||||
try
|
||||
C.StretchDraw(R, Picture.Graphic);
|
||||
finally
|
||||
FPainting:=false;
|
||||
end;
|
||||
|
||||
FUseAncestorCanvas := True;
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user