fix(calc-02): update stack labels for navigation and move modes

This commit is contained in:
2026-05-17 05:34:06 +02:00
parent 6dd9550890
commit 9abdc33713
2 changed files with 9 additions and 11 deletions
+8 -7
View File
@@ -137,9 +137,9 @@ function getStackDisplayValue(label) {
}
function getVisibleStackLabel(label) {
if (stackMode === 'navigation') {
if (stackMode === 'navigation' || stackMode === 'move') {
const indexMap = { X: 0, Y: 1, Z: 2, T: 3 };
return String(stackSelection + indexMap[label]);
return String(indexMap[label]);
}
return label;
}
@@ -147,7 +147,12 @@ function getVisibleStackLabel(label) {
function updateStackLabels() {
const stackLabels = ['T', 'Z', 'Y', 'X'];
for (const label of stackLabels) {
stackEls[label].dataset.label = getVisibleStackLabel(label);
const stackCell = stackEls[label].parentElement;
if (!stackCell) continue;
const labelEl = stackCell.querySelector('.stack-label');
if (labelEl) {
labelEl.textContent = `${getVisibleStackLabel(label)}:`;
}
}
}
@@ -193,10 +198,6 @@ function render() {
modeButton.textContent = calc.angleMode;
}
function stackModeToLabel(index) {
return ['X', 'Y', 'Z', 'T'][Math.max(0, Math.min(3, index))] ?? 'X';
}
function stopEditing(clearValue = false) {
if (clearValue) {
calc.inputValue = '';