mirror of
https://github.com/storytold/lightcraft.git
synced 2026-12-05 13:32:52 -05:00
- crates/engine/src/map/track.rs (ported from PR #916): TrackShape projects a track's segments once, cuts them at ±180°, ranks points for Douglas-Peucker (ends kept, ~0.6 pt error), builds a level per zoom in chunks clipped to the view. 2 million points (release): 370 ms to build, 1-29 ms per zoom level, a frame's clipped lines under 1 ms (big_track_cost, ignored by default). - crates/engine/src/tracklog.rs: map.trackLog (load path / gpx, active track, camera time zone offset, clear; session only; 50 MB, 2 million timed points; a refused file keeps the loaded log); photo.autoTagTracklog {loaded: true} tags from the active track with its offset. Files are read through read_file::read_regular under the byte cap (#3703's rule). - The GPX parser's track indexes, names and caps already come from craft-metadata. - Map view (panels/map/tracks.rs): a Tracklog button in the bottom toolbar with its menu (tracks, start / end / duration on the camera clock, Set Time Zone Offset…, Auto-Tag N Selected Photos, Fit Map to Tracklog, Load Another…, Clear); tracks drawn under the pins (others dimmed); the selected photos marked where Auto-Tag puts them. Load Tracklog… reads the file on a worker thread with an activity row ("Loading tracklog <file>") and fits the map when it lands. UI commands map.loadTrackLog, map.trackLog.autoTag, .setOffset, .fit; map.state.trackLog. - The tile credit moves above the toolbar (the longer toolbar made it cover Lock Markers) and the legend above the credit. - Tests: engine tests/tracklog.rs and map/tests_track.rs (ported); UI tests/map_tracks.rs (load and fit, track pick, ticks and auto-tag in one undo step, bad files / hostile tracks / tiny window, the worker thread's activity row). - Docs: map.md "Track logs", control protocol, LRC-MAP-TRACKLOG row; strings in all 17 catalogs. Ported from PR #916 by Jason Baldwin. Co-Authored-By: Jason Baldwin <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>