mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 10:59:29 +02:00
TAChart: Check that Chart.Extent buonds are ordered corectly.
git-svn-id: trunk@19604 -
This commit is contained in:
parent
56cc734a27
commit
a258bd419f
@ -1241,6 +1241,7 @@ begin
|
||||
FYGraphMax := FCurrentExtent.b.Y;
|
||||
exit;
|
||||
end;
|
||||
Extent.CheckBoundsOrder;
|
||||
|
||||
// Search # of points, min and max of all series
|
||||
FXGraphMin := Infinity;
|
||||
|
@ -241,6 +241,8 @@ type
|
||||
property Visible default true;
|
||||
end;
|
||||
|
||||
EExtentError = class(EChartError);
|
||||
|
||||
{ TChartExtent }
|
||||
|
||||
TChartExtent = class (TChartElement)
|
||||
@ -253,6 +255,7 @@ type
|
||||
procedure SetBounds(AIndex: Integer; const AValue: Double);
|
||||
procedure SetUseBounds(AIndex: Integer; AValue: Boolean);
|
||||
public
|
||||
procedure CheckBoundsOrder;
|
||||
property Extent: TDoubleRect read FExtent;
|
||||
published
|
||||
property XMin: Double index 1 read GetBounds write SetBounds;
|
||||
@ -780,6 +783,20 @@ begin
|
||||
Result := FUseBounds[AIndex];
|
||||
end;
|
||||
|
||||
procedure TChartExtent.CheckBoundsOrder;
|
||||
begin
|
||||
if UseXMin and UseXMax and (XMin >= XMax) then begin
|
||||
UseXMin := false;
|
||||
UseXMax := false;
|
||||
raise EExtentError.Create('ChartExtent: XMin >= XMax');
|
||||
end;
|
||||
if UseYMin and UseYMax and (YMin >= YMax) then begin
|
||||
UseYMin := false;
|
||||
UseYMax := false;
|
||||
raise EExtentError.Create('ChartExtent: YMin >= YMax');
|
||||
end;
|
||||
end;
|
||||
|
||||
function TChartExtent.GetBounds(AIndex: Integer): Double;
|
||||
begin
|
||||
Result := FExtent.coords[AIndex];
|
||||
|
Loading…
Reference in New Issue
Block a user