mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 16:59:19 +02:00
TAChart: Fix update of TListChartSource.ValuesTotal cache when adding or removing NaNs
git-svn-id: trunk@38694 -
This commit is contained in:
parent
6a15305fe4
commit
583c74c2cc
@ -463,7 +463,7 @@ begin
|
||||
(FExtent.a.X < X) and (X < FExtent.b.X) and
|
||||
(FExtent.a.Y < Y) and (Y < FExtent.b.Y);
|
||||
if FValuesTotalIsValid then
|
||||
FValuesTotal -= Y;
|
||||
FValuesTotal -= NumberOr(Y);
|
||||
end;
|
||||
Dispose(Item[AIndex]);
|
||||
FData.Delete(AIndex);
|
||||
@ -628,12 +628,8 @@ var
|
||||
begin
|
||||
oldY := Item[AIndex]^.Y;
|
||||
Item[AIndex]^.Y := AValue;
|
||||
if FValuesTotalIsValid then begin
|
||||
if not IsNan(AValue) then
|
||||
FValuesTotal += AValue;
|
||||
if not IsNan(oldY) then
|
||||
FValuesTotal -= oldY;
|
||||
end;
|
||||
if FValuesTotalIsValid then
|
||||
FValuesTotal += NumberOr(AValue) - NumberOr(oldY);
|
||||
UpdateExtent;
|
||||
Notify;
|
||||
end;
|
||||
@ -655,7 +651,7 @@ begin
|
||||
UpdateMinMax(AY, FExtent.a.Y, FExtent.b.Y);
|
||||
end;
|
||||
if FValuesTotalIsValid then
|
||||
FValuesTotal += AY;
|
||||
FValuesTotal += NumberOr(AY);
|
||||
Notify;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user