mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 12:20:46 +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,7 +464,6 @@ 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);
|
||||
@ -478,10 +477,6 @@ begin
|
||||
ev := FMouseEvents[Ord(AEventId)];
|
||||
if Assigned(ev) then
|
||||
ev(Self, APoint);
|
||||
finally
|
||||
if not IsActive then
|
||||
FChart := nil;
|
||||
end;
|
||||
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