File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1481,21 +1481,20 @@ impl App {
14811481 i. pointer
14821482 . button_double_clicked ( egui:: PointerButton :: Primary )
14831483 } ) ;
1484+ let mouse_is_visible = resp. contains_pointer ( ) ;
1485+ let mouse_pos_world = ui
1486+ . ctx ( )
1487+ . pointer_hover_pos ( )
1488+ . map ( |p| self . screen_to_world ( p) ) ;
1489+
14841490 let mouse_up = ui. input ( |i| i. pointer . any_released ( ) ) ;
14851491 // To use the canvas clicked we need to set everything on objects. Right now some stuff are
14861492 // on canvas rect
1487- let mouse_clicked = ui. input ( |i| i. pointer . primary_pressed ( ) ) ;
1488-
1493+ let mouse_clicked = ui. input ( |i| i. pointer . primary_pressed ( ) ) && mouse_is_visible;
14891494 let right_released = ui. input ( |i| i. pointer . secondary_released ( ) ) ;
14901495 let right_down = ui. input ( |i| i. pointer . secondary_down ( ) ) ;
14911496 let right_clicked = ui. input ( |i| i. pointer . secondary_clicked ( ) ) ;
14921497
1493- let mouse_is_visible = resp. contains_pointer ( ) ;
1494- let mouse_pos_world = ui
1495- . ctx ( )
1496- . pointer_hover_pos ( )
1497- . map ( |p| self . screen_to_world ( p) ) ;
1498-
14991498 let enter_pressed = ui. input ( |i| i. key_pressed ( egui:: Key :: Enter ) ) ;
15001499 let esc_pressed = ui. input ( |i| i. key_released ( egui:: Key :: Escape ) ) ;
15011500
You can’t perform that action at this time.
0 commit comments