forge
Explore
Log in

Don't you dare go Hollow

A clip let go in the bench's left gutter lands at frame 0

Browse files at this commit

bbc437bc4c98fb098813698e513cb7ea1831ffb1Ahmet Kaan GümüşParent: 8bd7e0c
  • fix
    • a clip let go in the bench's left gutter lands at frame 0
Show full message
🐛 fix(app): a clip let go in the bench's left gutter lands at frame 0

gpui fires on_drop only on an element whose own hitbox holds the pointer,
and the bench's 12px side gutter was padding on the parent div -- so a
release at x < 12, exactly where a hand aiming a clip at frame 0 puts it,
reached no drop target and moved nothing, silently. The gutter now lives
inside bench-content's own box: same pixels, and the catch-all release
already written there now covers the edge.
crates/app/src/ui/bench_stance.rsmodified+7 -0
@@ -1229,6 +1229,9 @@ fn lane_row(
12291229
12301230 /// The bench's content: pinned ruler, pinned heads, lane stack -- compressed
12311231 /// evenly to [`LANES_COMPRESS`] rows and then scrolling (DESIGN §7).
1232+/// The bench's side gutter, spent inside [`render`]'s own content box.
1233+const BENCH_GUTTER: f32 = 12.;
1234+
12321235 pub(crate) fn render(
12331236 player: &mut Player,
12341237 box_h: f32,
@@ -1292,6 +1295,10 @@ pub(crate) fn render(
12921295 .on_scroll_wheel(cx.listener(|this, event: &ScrollWheelEvent, _, cx| {
12931296 this.timeline_wheel(event, cx);
12941297 }))
1298+ // The bench's side gutter, spent here rather than by the `bench` div
1299+ // above, so this element's bounds -- and the catch-all release below
1300+ // with them -- reach the window edge (note at `ui::stance::bench`).
1301+ .px(px(BENCH_GUTTER))
12951302 // The catch-all release: a clip let go of anywhere on the bench that is
12961303 // not a lane row -- left of the tracks, in the gap between two rows, on
12971304 // the empty bench below the last one -- lands on the lane and the x the
crates/app/src/ui/stance.rsmodified+8 -1
@@ -615,7 +615,14 @@ fn bench(
615615 // the bench is the selection one a picked clip draws (DESIGN §2/§4).
616616 .flex()
617617 .flex_col()
618- .px(px(12.))
618+ // The 12px side gutter is spent INSIDE `bench_stance`'s own content
619+ // box, not here: gpui fires `on_drop` only on an element whose own
620+ // hitbox holds the pointer (`div.rs:2089`), and padding on this
621+ // parent left the gutter outside every registered target -- a clip
622+ // let go at x < 12, hard against the left edge where a hand aiming
623+ // at frame 0 puts it, reached nothing at all and moved nothing,
624+ // silently (DESIGN §8: a release that has aimed has made an edit).
625+ // Same box, same pixels; only the catch-all's bounds grow.
619626 .py(px(4.))
620627 .child(bench_stance::render(player, bench_h - BENCH_CHROME_H, cx))
621628 }