Changeset 172 for trunk/Packages/Common
- Timestamp:
- Nov 24, 2017, 10:11:54 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UGeometry.pas
r171 r172 6 6 7 7 uses 8 Classes, SysUtils, Math , typinfo;8 Classes, SysUtils, Math; 9 9 10 10 type … … 51 51 function Center: T; 52 52 procedure SetEmpty; 53 procedure Normalize; 53 54 class operator Equal(const A, B: TGRect<T>): Boolean; 54 55 constructor Create(const P1, P2: T); … … 201 202 Self.Points[0] := Rect.P1; 202 203 Self.Points[1] := T.Create(Rect.P2.X, Rect.P1.Y); 203 Self.Points[2] := Rect.P 1;204 Self.Points[2] := Rect.P2; 204 205 Self.Points[3] := T.Create(Rect.P1.X, Rect.P2.Y); 205 206 end; … … 320 321 function TGLine<T>.ToRect: TGRect<T>; 321 322 begin 322 Result.P1 := P1; 323 Result.P2 := P2; 323 Result := TGRect<T>.Create(P1, P2); 324 324 end; 325 325 … … 461 461 end; 462 462 463 procedure TGRect<T>.Normalize; 464 var 465 NewP1: T; 466 NewP2: T; 467 begin 468 NewP1 := P1.Min(P1, P2); 469 NewP2 := P1.Max(P1, P2); 470 P1 := NewP1; 471 P2 := NewP2; 472 end; 473 463 474 function TGRect<T>.Center: T; 464 475 begin … … 481 492 Self.P1 := P1; 482 493 Self.P2 := P2; 494 Normalize; 483 495 end; 484 496
Note:
See TracChangeset
for help on using the changeset viewer.