Changeset 107 for trunk/UTrack.pas


Ignore:
Timestamp:
Oct 4, 2022, 3:53:47 PM (19 months ago)
Author:
chronos
Message:
  • Fixed: Initial view resize on new game.
  • Fixed: Wrong train drawing position if track points distance close to zero.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTrack.pas

    r106 r107  
    130130    UpPoint := BaseTrackPoint.GetNeighUp;
    131131    if Assigned(UpPoint) then begin
     132      Result.Direction := SubPoint(UpPoint.Position, Position);
    132133      D := Distance(UpPoint.Position, Position);
    133134      if D > 0 then begin
    134         Result.Direction := SubPoint(UpPoint.Position, Position);
    135135        Result.Position := Point(Trunc(Position.X + Result.Direction.X * RelPos / D),
    136136          Trunc(Position.Y + Result.Direction.Y * RelPos / D));
     137      end else begin
     138        Result.Position := Position;
    137139      end;
    138140    end;
Note: See TracChangeset for help on using the changeset viewer.