This commit is contained in:
Mikayla Maki 2023-07-20 10:36:23 -07:00
parent 4d1dbb8aa3
commit d84d663ac3
No known key found for this signature in database

View file

@ -837,9 +837,8 @@ mod element {
self.basis + ix,
handle_bounds,
);
mouse_region = mouse_region.on_drag(
MouseButton::Left,
{
mouse_region = mouse_region
.on_drag(MouseButton::Left, {
let flexes = self.flexes.clone();
move |drag, workspace: &mut Workspace, cx| {
let min_size = match axis {
@ -853,7 +852,8 @@ mod element {
return;
}
let mut current_target_size = (drag.position - child_start).along(axis);
let mut current_target_size =
(drag.position - child_start).along(axis);
let proposed_current_pixel_change =
current_target_size - child_size.along(axis);
@ -873,8 +873,10 @@ mod element {
);
}
let current_pixel_change = current_target_size - child_size.along(axis);
let flex_change = current_pixel_change / drag_bounds.length_along(axis);
let current_pixel_change =
current_target_size - child_size.along(axis);
let flex_change =
current_pixel_change / drag_bounds.length_along(axis);
let current_target_flex = current_flex + flex_change;
let next_target_flex = next_flex - flex_change;
@ -884,8 +886,9 @@ mod element {
workspace.schedule_serialize(cx);
cx.notify();
}},
).on_click(MouseButton::Left, {
}
})
.on_click(MouseButton::Left, {
let flexes = self.flexes.clone();
move |e, v: &mut Workspace, cx| {
if e.click_count >= 2 {
@ -894,7 +897,8 @@ mod element {
v.schedule_serialize(cx);
cx.notify();
}
}});
}
});
scene.push_mouse_region(mouse_region);
scene.pop_stacking_context();