Position drag handle relative to cursor
This commit is contained in:
parent
fc927f7406
commit
258fcaea94
3 changed files with 24 additions and 20 deletions
|
@ -812,8 +812,8 @@ impl<'a, 'w> WindowContext<'a, 'w> {
|
|||
|
||||
if let Some(mut active_drag) = cx.active_drag.take() {
|
||||
cx.stack(1, |cx| {
|
||||
let mouse_position = cx.mouse_position();
|
||||
cx.with_element_offset(Some(mouse_position), |cx| {
|
||||
let offset = cx.mouse_position() - active_drag.cursor_offset;
|
||||
cx.with_element_offset(Some(offset), |cx| {
|
||||
let available_space =
|
||||
size(AvailableSpace::MinContent, AvailableSpace::MinContent);
|
||||
draw_any_view(&mut active_drag.drag_handle_view, available_space, cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue