Changeset 129
- Timestamp:
- May 1, 2023, 11:40:29 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r127 r129 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 7 ExtCtrls, UEngine, LCLType, StdCtrls, types, UTranslator, UApplicationInfo,7 ExtCtrls, UEngine, LCLType, Types, UTranslator, UApplicationInfo, 8 8 URegistry, UPersistentForm; 9 9 -
trunk/UEngine.pas
r128 r129 1453 1453 TempIntersect: TPoint; 1454 1454 begin 1455 Result := TTrackLink.Create; 1456 Result.Points.Count := 2; 1457 Result.Points[0] := nil; 1458 Result.Points[1] := nil; 1455 Result := nil; 1459 1456 I := 0; 1460 1457 MinD := High(Integer); … … 1466 1463 if (D < MinD) and (D < TrackClickDistance) then begin 1467 1464 MinD := D; 1468 Result.Points[0] := Track.Points[T - 1]; 1469 Result.Points[1] := Track.Points[T]; 1465 if not Assigned(Result) then 1466 Result := TTrackLink.Create; 1467 Result.Points.Add(Track.Points[T - 1]); 1468 Result.Points.Add(Track.Points[T]); 1470 1469 Intersect := TempIntersect; 1471 1470 end; … … 1946 1945 // Reset all trackpoints position shift 1947 1946 for MetroLine in Lines do 1948 for TrackPoint in MetroLine.Track.Points do 1949 TrackPoint.Position := TrackPoint.PositionDesigned; 1947 MetroLine.Track.Points.ResetToDesignatedPosition; 1950 1948 1951 1949 // Calculate new position shifts … … 1982 1980 Points[I].PositionDesigned + Points[I].LinkDown.Shift, 1983 1981 Points[I].PositionDesigned + Points[I].LinkUp.Shift, 1984 Points[I + 1].PositionDesigned + Points[I].LinkUp.Shift, NewPoint) then begin 1982 Points[I + 1].PositionDesigned + Points[I].LinkUp.Shift, NewPoint) then 1983 begin 1985 1984 Points[I].Position := NewPoint; 1986 1985 end else begin … … 3706 3705 end; 3707 3706 3708 // New TrackLink creation from selected station as start3707 // New track creation from selected station as start 3709 3708 Station := GetStationOnPos(View.PointDestToSrc(Position)); 3710 3709 if Assigned(Station) then begin … … 4055 4054 FreeAndNil(Doc); 4056 4055 end; 4056 LastTickTime := Now; 4057 4057 end; 4058 4058 -
trunk/UTrack.pas
r128 r129 64 64 class function GetClassSysName: string; override; 65 65 function CreateItem: TTrackPoint; override; 66 procedure ResetToDesignatedPosition; 66 67 end; 67 68 … … 240 241 end; 241 242 243 procedure TTrackPoints.ResetToDesignatedPosition; 244 var 245 I: Integer; 246 begin 247 for I := 0 to Count - 1 do 248 Items[I].Position := Items[I].PositionDesigned; 249 end; 250 242 251 { TTrack } 243 252
Note:
See TracChangeset
for help on using the changeset viewer.