Changeset 187


Ignore:
Timestamp:
Feb 17, 2018, 11:39:36 PM (7 years ago)
Author:
chronos
Message:
  • Added: TGPoint multiply operator to avoid FPC internal error.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UGeometry.pas

    r186 r187  
    2323    class operator LessThanOrEqual(const A, B: TGPoint<T>): Boolean;
    2424    class operator Equal(const A, B: TGPoint<T>): Boolean;
     25    class operator Multiply(const A, B: TGPoint<T>): TGPoint<T>;
    2526    function Min(const A, B: TGPoint<T>): TGPoint<T>;
    2627    function Max(const A, B: TGPoint<T>): TGPoint<T>;
     
    417418end;
    418419
     420class operator TGPoint<T>.Multiply(const A, B: TGPoint<T>): TGPoint<T>;
     421begin
     422  Result.X := A.X * B.X;
     423  Result.Y := A.Y * B.Y;
     424end;
     425
    419426class operator TGPoint<T>.GreaterThan(const A, B: TGPoint<T>): Boolean;
    420427begin
  • trunk/UMap.pas

    r177 r187  
    6464var
    6565  Shift: TPointF;
    66 begin
    67   Shift := TPointF.Create(0.5 * cos(30 / 180 * Pi), 0.5 * sin(30 / 180 * Pi));
     66  Angle: Double;
     67begin
     68  Angle := 30 / 180 * Pi;
     69  Shift := TPointF.Create(0.5, 0.5) * TPointF.Create(Cos(Angle), Sin(Angle));
    6870  SetLength(Result.Points, 6);
    6971  Result.Points[0] := TPoint.Create(Trunc(Pos.X + 0 * Size.X), Trunc(Pos.Y - 0.5 * Size.Y));
Note: See TracChangeset for help on using the changeset viewer.