mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 09:39:43 +01:00 
			
		
		
		
	TAChart: Introduce ZeroRect constant
git-svn-id: trunk@37664 -
This commit is contained in:
		
							parent
							
								
									8984c6dc6e
								
							
						
					
					
						commit
						21622f66e7
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -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));
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
 | 
			
		||||
@ -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));
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user