Browse Source

* add redundant trect.normalize as per delphi docs, copied from normalizerect

marcoonthegit 2 weeks ago
parent
commit
f7aa2f60dc
1 changed files with 19 additions and 0 deletions
  1. 19 0
      rtl/objpas/types.pp

+ 19 - 0
rtl/objpas/types.pp

@@ -314,6 +314,7 @@ type
     procedure Inflate(DL, DT, DR, DB: Single);
     procedure Inflate(DX, DY: Single);
     procedure Intersect(R: TRectF);
+    procedure Normalize;
     procedure NormalizeRect;
     procedure Offset (const dx,dy : Single); inline;
     procedure Offset (DP: TPointF); inline;
@@ -1881,6 +1882,24 @@ begin
   Result := (CompareValue(Right,Left)<=0) or (CompareValue(Bottom,Top)<=0);
 end;
 
+procedure TRectF.Normalize;
+var
+  x: Single;
+begin
+  if Top>Bottom then
+  begin
+    x := Top;
+    Top := Bottom;
+    Bottom := x;
+  end;
+  if Left>Right then
+  begin
+    x := Left;
+    Left := Right;
+    Right := x;
+  end
+end;
+
 procedure TRectF.NormalizeRect;
 var
   x: Single;