Align cut options with PT-P700 capabilities

This commit is contained in:
Mikei386
2026-06-22 11:56:27 +02:00
parent b26b9fe123
commit 941c68bbf8
9 changed files with 24 additions and 139 deletions
+3 -5
View File
@@ -19,7 +19,7 @@ const state = {
marginMm: 2,
orientation: "landscape",
cutMode: "auto",
halfcut: "on",
halfcut: "off",
objects: [],
},
};
@@ -33,7 +33,6 @@ const controls = {
lengthMm: document.getElementById("lengthMm"),
marginMm: document.getElementById("marginMm"),
cutMode: document.getElementById("cutMode"),
halfcut: document.getElementById("halfcut"),
copies: document.getElementById("copies"),
zoomLabel: document.getElementById("zoomLabel"),
previewImage: document.getElementById("previewImage"),
@@ -95,7 +94,7 @@ function syncDesignControls() {
state.design.lengthMm = Number(controls.lengthMm.value);
state.design.marginMm = Number(controls.marginMm.value);
state.design.cutMode = controls.cutMode.value;
state.design.halfcut = controls.halfcut.value;
state.design.halfcut = "off";
state.design.orientation = document.querySelector("input[name='orientation']:checked").value;
}
@@ -104,7 +103,6 @@ function applyDesignControls() {
controls.lengthMm.value = state.design.lengthMm;
controls.marginMm.value = state.design.marginMm;
controls.cutMode.value = state.design.cutMode || "auto";
controls.halfcut.value = state.design.halfcut || "on";
document.querySelector(`input[name='orientation'][value='${state.design.orientation}']`).checked = true;
}
@@ -413,7 +411,7 @@ window.addEventListener("keydown", (event) => {
}
});
["tapeWidth", "lengthMm", "marginMm", "cutMode", "halfcut"].forEach((id) => document.getElementById(id).addEventListener("input", draw));
["tapeWidth", "lengthMm", "marginMm", "cutMode"].forEach((id) => document.getElementById(id).addEventListener("input", draw));
document.querySelectorAll("input[name='orientation']").forEach((input) => input.addEventListener("change", draw));
Object.values(controls).forEach((control) => {
if (control && control.id && control.id.startsWith("prop")) control.addEventListener("input", applyProps);