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
w, x: Integer;
begin
ACheckBoxRect := Rect(-1, -1, -1, -1);
ASeriesIconRect := Rect(-1, -1, -1, -1);
ACheckBoxRect := ZeroRect;
ASeriesIconRect := ZeroRect;
w := GetSystemMetrics(SM_CYMENUCHECK);
x := 2;
if cloShowCheckboxes in Options then begin

View File

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

View File

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

View File

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

View File

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