TAChart: Introduce ZeroRect constant

git-svn-id: trunk@37664 -
This commit is contained in:
ask 2012-06-16 10:06:57 +00:00
parent 8984c6dc6e
commit 21622f66e7
5 changed files with 7 additions and 6 deletions

View File

@ -218,8 +218,8 @@ procedure TChartListbox.CalcRects(
var var
w, x: Integer; w, x: Integer;
begin begin
ACheckBoxRect := Rect(-1, -1, -1, -1); ACheckBoxRect := ZeroRect;
ASeriesIconRect := Rect(-1, -1, -1, -1); ASeriesIconRect := ZeroRect;
w := GetSystemMetrics(SM_CYMENUCHECK); w := GetSystemMetrics(SM_CYMENUCHECK);
x := 2; x := 2;
if cloShowCheckboxes in Options then begin if cloShowCheckboxes in Options then begin

View File

@ -250,6 +250,7 @@ const
'%4:.9g' // smsXValue '%4:.9g' // smsXValue
); );
ZeroDoublePoint: TDoublePoint = (X: 0; Y: 0); ZeroDoublePoint: TDoublePoint = (X: 0; Y: 0);
ZeroRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0);
EmptyDoubleRect: TDoubleRect = (coords: (0, 0, 0, 0)); EmptyDoubleRect: TDoubleRect = (coords: (0, 0, 0, 0));
EmptyExtent: TDoubleRect = EmptyExtent: TDoubleRect =
(coords: (Infinity, Infinity, NegInfinity, NegInfinity)); (coords: (Infinity, Infinity, NegInfinity, NegInfinity));

View File

@ -1001,7 +1001,7 @@ var
a: TRectArray absolute Result; a: TRectArray absolute Result;
s: TBasicChartSeries; s: TBasicChartSeries;
begin begin
Result := Rect(0, 0, 0, 0); Result := ZeroRect;
for s in Series do for s in Series do
if s.Active then if s.Active then
s.UpdateMargins(ADrawer, Result); s.UpdateMargins(ADrawer, Result);
@ -1171,7 +1171,7 @@ begin
// There is a cyclic dependency: extent -> visible marks -> margins. // There is a cyclic dependency: extent -> visible marks -> margins.
// We recalculate them iteratively hoping that the process converges. // We recalculate them iteratively hoping that the process converges.
CalculateTransformationCoeffs(Rect(0, 0, 0, 0)); CalculateTransformationCoeffs(ZeroRect);
cr := FClipRect; cr := FClipRect;
for tries := 1 to 10 do begin for tries := 1 to 10 do begin
axisMargin := AxisList.Measure(CurrentExtent); axisMargin := AxisList.Measure(CurrentExtent);

View File

@ -265,7 +265,7 @@ begin
FFullExtentPen.OnChange := @ChartExtentChanged; FFullExtentPen.OnChange := @ChartExtentChanged;
FLogicalExtentPen := TPen.Create; FLogicalExtentPen := TPen.Create;
FLogicalExtentPen.OnChange := @ChartExtentChanged; FLogicalExtentPen.OnChange := @ChartExtentChanged;
FLogicalExtentRect := Rect(0, 0, 0, 0); FLogicalExtentRect := ZeroRect;
Width := DEF_WIDTH; Width := DEF_WIDTH;
Height := DEF_HEIGHT; Height := DEF_HEIGHT;
FAllowDragNavigation := true; FAllowDragNavigation := true;

View File

@ -190,7 +190,7 @@ procedure TGeometryTest.TestExpandRect;
var var
r: TRect; r: TRect;
begin begin
r := Rect(0, 0, 0, 0); r := ZeroRect;
ExpandRect(r, Point(1, 2)); ExpandRect(r, Point(1, 2));
AssertEquals(Rect(0, 0, 1, 2), r); AssertEquals(Rect(0, 0, 1, 2), r);
ExpandRect(r, Point(-5, -6)); ExpandRect(r, Point(-5, -6));