TAChart: Do not invalidate chart on mouseclick if zooming was not changed

git-svn-id: trunk@23468 -
This commit is contained in:
ask 2010-01-15 13:23:27 +00:00
parent 05bb84fffb
commit 1e56a54ecc

View File

@ -912,6 +912,8 @@ begin
end; end;
procedure TChart.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure TChart.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
oldIsZoomed: Boolean;
begin begin
if not FIsMouseDown then begin if not FIsMouseDown then begin
inherited; inherited;
@ -924,19 +926,20 @@ begin
FIsMouseDown := false; FIsMouseDown := false;
with FSelectionRect do begin oldIsZoomed := FIsZoomed;
with FSelectionRect do
FIsZoomed := (Left < Right) and (Top < Bottom); FIsZoomed := (Left < Right) and (Top < Bottom);
if FIsZoomed then if FIsZoomed then
with FZoomExtent do begin with FZoomExtent do begin
a := ImageToGraph(TopLeft); a := ImageToGraph(FSelectionRect.TopLeft);
b := ImageToGraph(BottomRight); b := ImageToGraph(FSelectionRect.BottomRight);
if a.X > b.X then if a.X > b.X then
Exchange(a.X, b.X); Exchange(a.X, b.X);
if a.Y > b.Y then if a.Y > b.Y then
Exchange(a.Y, b.Y); Exchange(a.Y, b.Y);
end; end;
end;
if FIsZoomed or oldIsZoomed then
Invalidate; Invalidate;
end; end;