Shrink a clip with the wave and drop it with a click beside (#357)
Zoomed out, the wave left room above and below it, but the bright file, the picked clip and its handles still took the whole height. And a click in the wave beside the picked clip kept it picked, so only the strip could take it back to the sound. - fileReach in waveView.ts is how far up and down the file reaches: full scale and its inset, never past the area. At level 1 it is the whole height, zoomed in too. - The bright file, the shade outside the clip and the two handles are drawn within that reach. - A click over the wave beside the picked clip picks the sound. Inside the clip or on a handle nothing changes, and a drag still spans the clip anew. Tests: - Unit wave-view: 11 green (1 new), a counter-check red - e2e 34 (melektaus-atx): ALL PASSED, 91 checks (1 new) - Gate (melektaus-atx): CHECK EXIT 0, 271 files, 4195 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
42a3759d9d
commit
852dce5142
4 files changed
+53
-14
No files matched your search
@@ -66,6 +66,14 @@ export function levelOffset(amplitude: number, level: number, half: number): num
|
||||
return amplitude * level * half;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pixels from the middle the file and its clip reach up and down: full scale and `inset` around it,
|
||||
* zoomed out short of the area, zoomed in never past its `room` (#357).
|
||||
*/
|
||||
export function fileReach(level: number, half: number, inset: number, room: number): number {
|
||||
return Math.min(room, levelOffset(1, level, half) + inset);
|
||||
}
|
||||
|
||||
/**
|
||||
* The marks of the level scale: every 6 dB down from 0, as far from the middle as they are drawn.
|
||||
* Only those within `room` of the middle and at least `minPx` from it – 6 dB halve the distance,
|
||||
|
||||
Reference in new issue
Block a user