Changeset 240 for trunk/UClientGUI.pas


Ignore:
Timestamp:
Sep 21, 2018, 1:19:30 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: An error on drawing of vertical unit move arrow.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientGUI.pas

    r238 r240  
    241241      if Move.CountRepeat > 0 then Pen.Width := 2
    242242        else Pen.Width := 1;
    243       Angle := ArcTan((PosTo.Y - PosFrom.Y) / (PosTo.X - PosFrom.X));
     243      Angle := ArcTan2(PosTo.Y - PosFrom.Y, PosTo.X - PosFrom.X);
    244244      if (Angle > +Pi) or (Angle < -Pi) then
    245245        raise Exception.Create(Format(SWrongArrowAngle, [FloatToStr(Angle)]));
    246246
    247       if Sign(PosTo.X - PosFrom.X) = -1 then Angle := Angle + Pi;
    248247      ArrowCenter := View.CellToCanvasPos(TPoint.Create(
    249248        Trunc(PosFrom.X + (PosTo.X - PosFrom.X) / 2),
Note: See TracChangeset for help on using the changeset viewer.