TAChart: Do not store zero extent bounds.

git-svn-id: trunk@19627 -
This commit is contained in:
ask 2009-04-26 06:27:11 +00:00
parent 9d7d926126
commit 4f29817505

View File

@ -252,16 +252,17 @@ type
function GetBounds(AIndex: Integer): Double;
function GetUseBounds(AIndex: integer): Boolean;
function IsBoundsStored(AIndex: Integer): boolean;
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;
property YMin: Double index 2 read GetBounds write SetBounds;
property XMax: Double index 3 read GetBounds write SetBounds;
property YMax: Double index 4 read GetBounds write SetBounds;
property XMin: Double index 1 read GetBounds write SetBounds stored IsBoundsStored;
property YMin: Double index 2 read GetBounds write SetBounds stored IsBoundsStored;
property XMax: Double index 3 read GetBounds write SetBounds stored IsBoundsStored;
property YMax: Double index 4 read GetBounds write SetBounds stored IsBoundsStored;
property UseXMin: Boolean index 1 read GetUseBounds write SetUseBounds default false;
property UseYMin: Boolean index 2 read GetUseBounds write SetUseBounds default false;
property UseXMax: Boolean index 3 read GetUseBounds write SetUseBounds default false;
@ -783,6 +784,11 @@ begin
Result := FUseBounds[AIndex];
end;
function TChartExtent.IsBoundsStored(AIndex: Integer): boolean;
begin
Result := FExtent.coords[AIndex] <> 0;
end;
procedure TChartExtent.CheckBoundsOrder;
begin
if UseXMin and UseXMax and (XMin >= XMax) then begin