TAChart: Do not redraw if LogicalExtent is re-assigned to the same value

git-svn-id: trunk@29927 -
This commit is contained in:
ask 2011-03-20 13:38:23 +00:00
parent 4248b7497e
commit ba7c0506c4
2 changed files with 10 additions and 5 deletions

View File

@ -66,6 +66,7 @@ operator *(const A, B: TPoint): TPoint; inline;
operator *(const A, B: TDoublePoint): TDoublePoint; overload; inline;
operator /(const A, B: TDoublePoint): TDoublePoint; overload; inline;
operator = (const A, B: TDoublePoint): Boolean; overload; inline;
operator = (const A, B: TDoubleRect): Boolean; overload; inline;
operator <= (const A, B: TDoublePoint): Boolean; overload; inline;
operator :=(const APoint: TPoint): TSize; inline;
operator :=(const ASize: TSize): TPoint; inline;
@ -435,6 +436,11 @@ begin
Result := (A.X = B.X) and (A.Y = B.Y);
end;
operator = (const A, B: TDoubleRect): Boolean;
begin
Result := (A.a = B.a) and (A.b = B.b);
end;
operator <= (const A, B: TDoublePoint): Boolean;
begin
Result := (A.X <= B.X) and (A.Y <= B.Y);

View File

@ -325,7 +325,8 @@ type
read FOnAfterDrawBackground write SetOnAfterDrawBackground;
property OnAfterDrawBackWall: TChartAfterDrawEvent
read FOnAfterDrawBackWall write SetOnAfterDrawBackWall;
property OnBeforeDrawBackground: TChartBeforeDrawEvent read FOnBeforeDrawBackground write SetOnBeforeDrawBackground;
property OnBeforeDrawBackground: TChartBeforeDrawEvent
read FOnBeforeDrawBackground write SetOnBeforeDrawBackground;
property OnBeforeDrawBackWall: TChartBeforeDrawEvent
read FOnBeforeDrawBackWall write SetOnBeforeDrawBackWall;
property OnDrawReticule: TDrawReticuleEvent
@ -686,10 +687,7 @@ begin
for i := 0 to SeriesCount - 1 do
Series[i].AfterDraw;
if
(FPrevLogicalExtent.a <> FLogicalExtent.a) or
(FPrevLogicalExtent.b <> FLogicalExtent.b)
then begin
if FPrevLogicalExtent <> FLogicalExtent then begin
FExtentBroadcaster.Broadcast(Self);
if Assigned(OnExtentChanged) then
OnExtentChanged(Self);
@ -1119,6 +1117,7 @@ end;
procedure TChart.SetLogicalExtent(const AValue: TDoubleRect);
begin
if FLogicalExtent = AValue then exit;
HideReticule;
FLogicalExtent := AValue;
FIsZoomed := true;