fix(calc-02): update stack labels for navigation and move modes
This commit is contained in:
@@ -123,10 +123,7 @@ body {
|
||||
padding-block: 0;
|
||||
}
|
||||
|
||||
.stack-label {
|
||||
text-align: right;
|
||||
opacity: 0.78;
|
||||
}
|
||||
/* removed extra first-column styling */
|
||||
|
||||
.stack-value {
|
||||
min-height: 0;
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user