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
+1 -4
View File
@@ -123,10 +123,7 @@ body {
padding-block: 0; padding-block: 0;
} }
.stack-label { /* removed extra first-column styling */
text-align: right;
opacity: 0.78;
}
.stack-value { .stack-value {
min-height: 0; min-height: 0;
+8 -7
View File
@@ -137,9 +137,9 @@ function getStackDisplayValue(label) {
} }
function getVisibleStackLabel(label) { function getVisibleStackLabel(label) {
if (stackMode === 'navigation') { if (stackMode === 'navigation' || stackMode === 'move') {
const indexMap = { X: 0, Y: 1, Z: 2, T: 3 }; const indexMap = { X: 0, Y: 1, Z: 2, T: 3 };
return String(stackSelection + indexMap[label]); return String(indexMap[label]);
} }
return label; return label;
} }
@@ -147,7 +147,12 @@ function getVisibleStackLabel(label) {
function updateStackLabels() { function updateStackLabels() {
const stackLabels = ['T', 'Z', 'Y', 'X']; const stackLabels = ['T', 'Z', 'Y', 'X'];
for (const label of stackLabels) { 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; modeButton.textContent = calc.angleMode;
} }
function stackModeToLabel(index) {
return ['X', 'Y', 'Z', 'T'][Math.max(0, Math.min(3, index))] ?? 'X';
}
function stopEditing(clearValue = false) { function stopEditing(clearValue = false) {
if (clearValue) { if (clearValue) {
calc.inputValue = ''; calc.inputValue = '';