mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
Trail modes + the tip grows glued to the icon
«Показывать путь робота» is a three-way choice now: never / while cleaning (the default — the line hides the moment the run ends) / always (the only mode that also shows the faded previous run). trail_mode rides next to the legacy bool, which still maps in. The last segment no longer pops in when the next telemetry point arrives: a rAF sampler drags a tip line's endpoint to the puck's animated centre every frame, so the path visually pours out strictly from under the icon. The sampler runs only while pucks exist and stops itself.
This commit is contained in:
@@ -290,3 +290,13 @@ export function reanchorFit(p: FitParams, prev: FitParams, sx: number, sy: numbe
|
||||
const [qx, qy] = applyAffine(trial, sx, sy);
|
||||
return { ...p, ox: px - qx, oy: py - qy };
|
||||
}
|
||||
|
||||
export type VacTrailMode = 'never' | 'cleaning' | 'always';
|
||||
|
||||
/** marker.vacuum → display mode; legacy bool maps in (false = never). */
|
||||
export function vacTrailMode(v: { trail?: boolean | null; trail_mode?: string | null } | null | undefined): VacTrailMode {
|
||||
const m = v?.trail_mode;
|
||||
if (m === 'never' || m === 'cleaning' || m === 'always') return m;
|
||||
if (v?.trail === false) return 'never';
|
||||
return 'cleaning';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user