Fix input text for effects

This commit is contained in:
osiu97
2026-07-08 21:44:08 +02:00
parent ebc634b4ee
commit d60fa36c83
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -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
+3 -3
View File
@@ -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 {