Merge pull request #92 from kamirr/kek/fix_cursor_in_graph

draw_graph_editor: fix cursor_in_editor
This commit is contained in:
setzer22 2023-05-15 11:22:56 +02:00 committed by GitHub
commit d2eaf38754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,12 +114,12 @@ where
// (so for windows it will use up to the resizeably set limit
// and for a Panel it will fill it completely)
let editor_rect = ui.max_rect();
ui.allocate_rect(editor_rect, Sense::hover());
let resp = ui.allocate_rect(editor_rect, Sense::hover());
let cursor_pos = ui
.ctx()
.input(|i| i.pointer.hover_pos().unwrap_or(Pos2::ZERO));
let mut cursor_in_editor = editor_rect.contains(cursor_pos);
let mut cursor_in_editor = resp.hovered();
let mut cursor_in_finder = false;
// Gets filled with the node metrics as they are drawn