This commit is contained in:
2024-06-01 18:52:46 +02:00
parent da27582b64
commit 80fa033a88
8 changed files with 135 additions and 104 deletions

View File

@@ -54,7 +54,9 @@
function toggle(index: number) {
if (!track.value) return;
track.value.toggleUnit(index);
if (selectedTool.value === 'track-unit-type') {
track.value.toggleUnit(index);
}
if (track.value.getUnitByIndex(index)?.on) {
applyCurrentToolToTrackUnit(index);
}
@@ -75,10 +77,7 @@
track.value?.setStickingType(index, activeStickingType.value);
break;
case "track-unit-type":
track.value?.updateUnit(index, { on: true, type: activeTrackUnitType.value });
break;
case "eraser":
track.value?.setUnitOn(index, false);
track.value?.updateUnit(index, { on: activeTrackUnitType.value === null ? false : true, type: activeTrackUnitType.value === null ? undefined : activeTrackUnitType.value });
break;
}
}