Changeset 168 for trunk/Packages/Common/UGeometry.pas
- Timestamp:
- Nov 23, 2017, 10:16:50 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UGeometry.pas
r167 r168 38 38 function Create(const Points: TPointArray): TPolygon; overload; 39 39 function Create(const Rect: TRect): TPolygon; overload; 40 function GetRect: TRect; 40 41 procedure AddPoint(const P: TPoint); 41 42 procedure Clear; … … 63 64 function SubAngle(A1, A2: Double): Double; 64 65 66 65 67 implementation 66 68 … … 291 293 Result.Points[2] := Point(Rect.Right, Rect.Bottom); 292 294 Result.Points[3] := Point(Rect.Left, Rect.Bottom); 295 end; 296 297 function TPolygon.GetRect: TRect; 298 var 299 I: Integer; 300 begin 301 Result := Rect(High(Integer), High(Integer), 302 Low(Integer), Low(Integer)); 303 for I := 0 to Length(Points) - 1 do 304 with Points[I] do begin 305 if X > Result.Right then 306 Result.Right := X; 307 if X < Result.Left then 308 Result.Left := X; 309 if Y > Result.Bottom then 310 Result.Bottom := Y; 311 if Y < Result.Top then 312 Result.Top := Y; 313 end; 293 314 end; 294 315
Note:
See TracChangeset
for help on using the changeset viewer.