mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 06:36:48 +02:00
TAChart: Properly set TCustomAnimatedChartSource.XCount and .YCount for the case that its Origin in nil. Issue #35388, modified patch by Marcin Wiazowski.
git-svn-id: trunk@61022 -
This commit is contained in:
parent
5004cea104
commit
a58d97ece8
@ -83,17 +83,29 @@ implementation
|
||||
uses
|
||||
LCLIntf, Math, SysUtils;
|
||||
|
||||
type
|
||||
TCustomChartSourceAccess = class(TCustomChartSource);
|
||||
|
||||
{ TCustomAnimatedChartSource }
|
||||
|
||||
procedure TCustomAnimatedChartSource.Changed(ASender: TObject);
|
||||
begin
|
||||
Unused(ASender);
|
||||
if FOrigin <> nil then begin
|
||||
FXCount := Origin.XCount;
|
||||
FYCount := Origin.YCount;
|
||||
end else begin
|
||||
FXCount := MaxInt;
|
||||
FYCount := MaxInt;
|
||||
end;
|
||||
Notify;
|
||||
end;
|
||||
|
||||
constructor TCustomAnimatedChartSource.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FXCount := MaxInt;
|
||||
FYCount := MaxInt;
|
||||
FListener := TListener.Create(@FOrigin, @Changed);
|
||||
FTimer := TCustomTimer.Create(nil);
|
||||
FTimer.Enabled := false;
|
||||
@ -187,6 +199,7 @@ begin
|
||||
FOrigin := AValue;
|
||||
if FOrigin <> nil then
|
||||
FOrigin.Broadcaster.Subscribe(FListener);
|
||||
Changed(nil);
|
||||
end;
|
||||
|
||||
procedure TCustomAnimatedChartSource.SetXCount(AValue: Cardinal);
|
||||
|
Loading…
Reference in New Issue
Block a user