mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 17:37:59 +01:00
TAChart: Unassign tool's chart reference during deactivation.
This fixes issue #17507 git-svn-id: trunk@27571 -
This commit is contained in:
parent
e7ce0b0dac
commit
11c20399c2
@ -1211,6 +1211,7 @@ procedure TBasicChartTool.Deactivate;
|
||||
begin
|
||||
FChart.MouseCapture := false;
|
||||
FChart.FActiveToolIndex := -1;
|
||||
FChart := nil;
|
||||
end;
|
||||
|
||||
procedure SkipObsoleteChartProperties;
|
||||
|
||||
@ -464,24 +464,19 @@ var
|
||||
begin
|
||||
if not Enabled or (FChart <> nil) and (FChart <> AChart) then exit;
|
||||
FChart := AChart;
|
||||
try
|
||||
ev := FMouseEvents[Ord(AEventId) + Ord(High(AEventId)) + 1];
|
||||
if Assigned(ev) then begin
|
||||
ev(Self, APoint);
|
||||
if Toolset.FIsHandled then exit;
|
||||
end;
|
||||
case AEventId of
|
||||
evidMouseDown: MouseDown(APoint);
|
||||
evidMouseMove: MouseMove(APoint);
|
||||
evidMouseUp : MouseUp (APoint);
|
||||
end;
|
||||
ev := FMouseEvents[Ord(AEventId)];
|
||||
if Assigned(ev) then
|
||||
ev(Self, APoint);
|
||||
finally
|
||||
if not IsActive then
|
||||
FChart := nil;
|
||||
ev := FMouseEvents[Ord(AEventId) + Ord(High(AEventId)) + 1];
|
||||
if Assigned(ev) then begin
|
||||
ev(Self, APoint);
|
||||
if Toolset.FIsHandled then exit;
|
||||
end;
|
||||
case AEventId of
|
||||
evidMouseDown: MouseDown(APoint);
|
||||
evidMouseMove: MouseMove(APoint);
|
||||
evidMouseUp : MouseUp (APoint);
|
||||
end;
|
||||
ev := FMouseEvents[Ord(AEventId)];
|
||||
if Assigned(ev) then
|
||||
ev(Self, APoint);
|
||||
end;
|
||||
|
||||
function TChartTool.GetIndex: Integer;
|
||||
@ -686,12 +681,12 @@ end;
|
||||
procedure TBasicZoomTool.DoZoom(const ANewExtent: TDoubleRect; AFull: Boolean);
|
||||
begin
|
||||
if (AnimationInterval = 0) or (AnimationSteps = 0) then begin
|
||||
if IsActive then
|
||||
Deactivate;
|
||||
if AFull then
|
||||
FChart.ZoomFull
|
||||
else
|
||||
FChart.LogicalExtent := ANewExtent;
|
||||
if IsActive then
|
||||
Deactivate;
|
||||
exit;
|
||||
end;
|
||||
if not IsActive then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user