fmt
This commit is contained in:
parent
4d1dbb8aa3
commit
d84d663ac3
1 changed files with 58 additions and 54 deletions
|
@ -837,9 +837,8 @@ mod element {
|
||||||
self.basis + ix,
|
self.basis + ix,
|
||||||
handle_bounds,
|
handle_bounds,
|
||||||
);
|
);
|
||||||
mouse_region = mouse_region.on_drag(
|
mouse_region = mouse_region
|
||||||
MouseButton::Left,
|
.on_drag(MouseButton::Left, {
|
||||||
{
|
|
||||||
let flexes = self.flexes.clone();
|
let flexes = self.flexes.clone();
|
||||||
move |drag, workspace: &mut Workspace, cx| {
|
move |drag, workspace: &mut Workspace, cx| {
|
||||||
let min_size = match axis {
|
let min_size = match axis {
|
||||||
|
@ -853,7 +852,8 @@ mod element {
|
||||||
return;
|
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 =
|
let proposed_current_pixel_change =
|
||||||
current_target_size - child_size.along(axis);
|
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 current_pixel_change =
|
||||||
let flex_change = current_pixel_change / drag_bounds.length_along(axis);
|
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 current_target_flex = current_flex + flex_change;
|
||||||
let next_target_flex = next_flex - flex_change;
|
let next_target_flex = next_flex - flex_change;
|
||||||
|
|
||||||
|
@ -884,8 +886,9 @@ mod element {
|
||||||
|
|
||||||
workspace.schedule_serialize(cx);
|
workspace.schedule_serialize(cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}},
|
}
|
||||||
).on_click(MouseButton::Left, {
|
})
|
||||||
|
.on_click(MouseButton::Left, {
|
||||||
let flexes = self.flexes.clone();
|
let flexes = self.flexes.clone();
|
||||||
move |e, v: &mut Workspace, cx| {
|
move |e, v: &mut Workspace, cx| {
|
||||||
if e.click_count >= 2 {
|
if e.click_count >= 2 {
|
||||||
|
@ -894,7 +897,8 @@ mod element {
|
||||||
v.schedule_serialize(cx);
|
v.schedule_serialize(cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
}});
|
}
|
||||||
|
});
|
||||||
scene.push_mouse_region(mouse_region);
|
scene.push_mouse_region(mouse_region);
|
||||||
|
|
||||||
scene.pop_stacking_context();
|
scene.pop_stacking_context();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue