Fix input text for effects
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user