mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-04 01:22:32 +00:00
enable routing tool without selection, and support multi-select
This commit is contained in:
@@ -532,6 +532,32 @@ export const dbUtils = {
|
||||
});
|
||||
});
|
||||
},
|
||||
createRoundTripForSelection() {
|
||||
if (!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints'])) {
|
||||
return;
|
||||
}
|
||||
applyGlobal((draft) => {
|
||||
applyToOrderedSelectedItemsFromFile((fileId, level, items) => {
|
||||
let file = draft.get(fileId);
|
||||
if (file) {
|
||||
if (level === ListLevel.FILE) {
|
||||
file.roundTrip();
|
||||
} else if (level === ListLevel.TRACK) {
|
||||
for (let item of items) {
|
||||
let trackIndex = (item as ListTrackItem).getTrackIndex();
|
||||
file.roundTripTrack(trackIndex);
|
||||
}
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
for (let item of items) {
|
||||
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
|
||||
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
|
||||
file.roundTripTrackSegment(trackIndex, segmentIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
mergeSelection: (mergeTraces: boolean) => {
|
||||
applyGlobal((draft) => {
|
||||
let first = true;
|
||||
|
Reference in New Issue
Block a user