File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ impl ContextMenuSystem {
17
17
fn sense_click ( & mut self , response : & Response ) -> MenuResponse {
18
18
let response = response. interact ( Sense :: click ( ) ) ;
19
19
let pointer = & response. ctx . input ( ) . pointer ;
20
- if pointer. any_click ( ) {
20
+ if pointer. any_pressed ( ) {
21
21
if let Some ( pos) = pointer. interact_pos ( ) {
22
22
let mut destroy = false ;
23
23
let mut in_old_menu = false ;
@@ -26,9 +26,10 @@ impl ContextMenuSystem {
26
26
destroy = context_menu. ui_id == response. id ;
27
27
}
28
28
if !in_old_menu {
29
- if response. secondary_clicked ( ) {
29
+ let in_target = response. rect . contains ( pos) ;
30
+ if in_target && pointer. secondary_down ( ) {
30
31
return MenuResponse :: Create ( pos) ;
31
- } else if response . clicked ( ) || destroy {
32
+ } else if ( in_target && pointer . primary_down ( ) ) || destroy {
32
33
return MenuResponse :: Close ;
33
34
}
34
35
}
You can’t perform that action at this time.
0 commit comments