mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:29:34 +02:00
TAChart: Undo r60740 #b2a4a7868b (sorting of ListSource by y value). Issue #35188, patch by Marcin Wiazowski.
git-svn-id: trunk@60904 -
This commit is contained in:
parent
b3b741485d
commit
48c62ca44d
@ -854,28 +854,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function CompareDataItemY(AItem1, AItem2: Pointer): Integer;
|
||||
var
|
||||
i: Integer;
|
||||
item1: PChartDataItem absolute AItem1;
|
||||
item2: PChartDataItem absolute AItem2;
|
||||
begin
|
||||
Result := CompareFloat(item1^.Y, item2^.Y);
|
||||
if Result = 0 then
|
||||
for i := 0 to Min(High(item1^.YList), High(item2^.YList)) do begin
|
||||
Result := CompareFloat(item1^.YList[i], item2^.YList[i]);
|
||||
if Result <> 0 then
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TListChartSource.Sort;
|
||||
begin
|
||||
if XCount > 0 then
|
||||
FData.Sort(@CompareDataItemX)
|
||||
else
|
||||
if YCount > 0 then
|
||||
FData.Sort(@CompareDataItemY);
|
||||
FData.Sort(@CompareDataItemX);
|
||||
end;
|
||||
|
||||
procedure TListChartSource.UpdateCachesAfterAdd(AX, AY: Double);
|
||||
|
Loading…
Reference in New Issue
Block a user