瀏覽代碼

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

marcoonthegit 1 月之前
父節點
當前提交
f7aa2f60dc
共有 1 個文件被更改,包括 19 次插入0 次删除
  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;