소스 검색

+ operator TPointF./, resolves #40046

(cherry picked from commit 1761d3c09d93c61f3854022e4cc12392a27906ef)
florian 2 년 전
부모
커밋
99d402aea8
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      rtl/objpas/types.pp

+ 6 - 0
rtl/objpas/types.pp

@@ -142,6 +142,7 @@ type
           class operator * (const apt1, apt2: TPointF): TPointF;
           class operator * (const apt1: TPointF; afactor: single): TPointF;
           class operator * (afactor: single; const apt1: TPointF): TPointF;
+          class operator / (const apt1: TPointF; afactor: single): TPointF;
           class operator := (const apt: TPoint): TPointF;
           class operator ** (const apt1, apt2: TPointF): Single; // scalar product
        end;
@@ -763,6 +764,11 @@ begin
   Result.y:=-apt1.y;
 end;
 
+class operator TPointF. / (const apt1: TPointF; afactor: single): TPointF;
+begin
+  result:=apt1.Scale(1/afactor);
+end;
+
 class operator TPointF. := (const apt: TPoint): TPointF;
 begin
   Result.x:=apt.x;