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:
wp 2019-04-19 15:39:03 +00:00
parent 5004cea104
commit a58d97ece8

View File

@ -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);