ソースを参照

* Add TPointF.Zero

Michaël Van Canneyt 1 年間 前
コミット
b3d3b65bdf
1 ファイル変更8 行追加0 行削除
  1. 8 0
      rtl/objpas/types.pp

+ 8 - 0
rtl/objpas/types.pp

@@ -159,6 +159,7 @@ type
           function MidPoint(const b: TPointF): TPointF;
           class function PointInCircle(const pt, center: TPointF; radius: single): Boolean; static;
           class function PointInCircle(const pt, center: TPointF; radius: integer): Boolean; static;
+          class function Zero: TPointF; inline; static;
           function Angle(const b: TPointF): Single;
           function AngleCosine(const b: TPointF): single;
 
@@ -838,6 +839,13 @@ begin
   result.y := 0.5 * (y + b.y);
 end;
 
+class function TPointF.Zero: TPointF; 
+
+begin
+  Result.X:=0;
+  Result.Y:=0;
+end;
+
 class function TPointF.PointInCircle(const pt, center: TPointF; radius: single): Boolean;
 begin
   result := sqr(center.x - pt.x) + sqr(center.y - pt.y) < sqr(radius);