From d60fa36c837e185373c5f214403e0a1824dd4203 Mon Sep 17 00:00:00 2001 From: osiu97 Date: Wed, 8 Jul 2026 21:44:08 +0200 Subject: [PATCH] Fix input text for effects --- web/js/motion-effects.js | 2 ++ web/js/sections/input-text.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/js/motion-effects.js b/web/js/motion-effects.js index 3fa26a3..fb5c3ee 100644 --- a/web/js/motion-effects.js +++ b/web/js/motion-effects.js @@ -114,6 +114,8 @@ export const MotionEffects = { // Called to apply per-waypoint visual perturbations applyPerturbation(px, py, nx, ny, fraction, distance, mode) { + if (fraction === 1) return { px, py }; // Always hit exact target at the end + if (mode === 'snaky') { const cycles = Math.max(1, Math.floor(distance / 50)); const offset = Math.sin(fraction * Math.PI * 2 * cycles) * 30; // 30mm amplitude diff --git a/web/js/sections/input-text.js b/web/js/sections/input-text.js index 5502168..5678cf2 100644 --- a/web/js/sections/input-text.js +++ b/web/js/sections/input-text.js @@ -277,10 +277,10 @@ function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } -async function executeMove(spot) { +async function executeMove(spot, forceDirect = false) { UI.log(`Spelling: ${spot.label}`, 'info'); const modeEl = document.getElementById('text-mode-select'); - const mode = modeEl ? modeEl.value : 'direct'; + const mode = forceDirect ? 'direct' : (modeEl ? modeEl.value : 'direct'); return await Motion.goto(spot.x, spot.y, mode); } @@ -313,7 +313,7 @@ async function spellText(text) { const spot = spots.find(s => s.id.toUpperCase() === char); if (spot) { - await executeMove(spot); + await executeMove(spot, i === 0); // Wait for delay await delay(Settings.delay); } else {