MCPcopy
hub / github.com/game1024/OpenSpeedy / toSpeed

Function toSpeed

src/components/SpeedPanel.tsx:7–10  ·  view source on GitHub ↗
(v: number)

Source from the content-addressed store, hash-verified

5// ── Speed mapping: slider [-999, 999] → speed [0.001, 1000], 1× at 0 ──
6
7export function toSpeed(v: number): number {
8 if (v <= 0) { return 1 + v * 0.001; }
9 else { return 1 + v; }
10}
11export function toSlider(s: number): number {
12 if (s <= 1.0) return (s - 1) / 0.001;
13 else return s - 1;

Callers 1

SpeedPanel.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected