Rework presenter dispatch_event to allow isolated propogation of individual MouseRegionEvent types Co-Authored-By: mikayla@zed.dev

This commit is contained in:
K Simmons 2022-08-12 19:00:48 -07:00
parent 0d6125889f
commit 3fb4e6356c
6 changed files with 303 additions and 321 deletions

View file

@ -190,7 +190,7 @@ impl Sidebar {
.with_cursor_style(CursorStyle::ResizeLeftRight)
.on_down(MouseButton::Left, |_, _| {}) // This prevents the mouse down event from being propagated elsewhere
.on_drag(MouseButton::Left, move |e, cx| {
let delta = e.prev_drag_position.x() - e.position.x();
let delta = e.prev_mouse_position.x() - e.position.x();
let prev_width = *actual_width.borrow();
*custom_width.borrow_mut() = 0f32
.max(match side {