@@ -22,7 +22,7 @@ use wgui::{
2222 slider:: ComponentSlider ,
2323 } ,
2424 event:: {
25- Event as WguiEvent , EventCallback , EventListenerID , EventListenerKind ,
25+ DeviceBitmask , Event as WguiEvent , EventCallback , EventListenerID , EventListenerKind ,
2626 InternalStateChangeEvent , MouseButtonEvent , MouseButtonIndex , MouseLeaveEvent ,
2727 MouseMotionEvent , MouseWheelEvent ,
2828 } ,
@@ -368,15 +368,15 @@ impl<S: 'static> OverlayBackend for GuiPanel<S> {
368368 let e = WguiEvent :: MouseWheel ( MouseWheelEvent {
369369 delta : vec2 ( delta. x , delta. y ) / 8.0 ,
370370 pos : hit. uv * self . layout . content_size ,
371- device : hit. pointer ,
371+ device : DeviceBitmask :: from_usize ( hit. pointer ) ,
372372 } ) ;
373373 self . push_event ( app, & e) ;
374374 }
375375
376376 fn on_hover ( & mut self , app : & mut AppState , hit : & PointerHit ) -> HoverResult {
377377 let e = & WguiEvent :: MouseMotion ( MouseMotionEvent {
378378 pos : hit. uv * self . layout . content_size ,
379- device : hit. pointer ,
379+ device : DeviceBitmask :: from_usize ( hit. pointer ) ,
380380 } ) ;
381381
382382 self . has_focus [ hit. pointer ] = true ;
@@ -397,7 +397,9 @@ impl<S: 'static> OverlayBackend for GuiPanel<S> {
397397 }
398398
399399 fn on_left ( & mut self , app : & mut AppState , pointer : usize ) {
400- let e = WguiEvent :: MouseLeave ( MouseLeaveEvent { device : pointer } ) ;
400+ let e = WguiEvent :: MouseLeave ( MouseLeaveEvent {
401+ device : DeviceBitmask :: from_usize ( pointer) ,
402+ } ) ;
401403 self . has_focus [ pointer] = false ;
402404 self . push_event ( app, & e) ;
403405 }
@@ -414,13 +416,13 @@ impl<S: 'static> OverlayBackend for GuiPanel<S> {
414416 WguiEvent :: MouseDown ( MouseButtonEvent {
415417 pos : hit. uv * self . layout . content_size ,
416418 index,
417- device : hit. pointer ,
419+ device : DeviceBitmask :: from_usize ( hit. pointer ) ,
418420 } )
419421 } else {
420422 WguiEvent :: MouseUp ( MouseButtonEvent {
421423 pos : hit. uv * self . layout . content_size ,
422424 index,
423- device : hit. pointer ,
425+ device : DeviceBitmask :: from_usize ( hit. pointer ) ,
424426 } )
425427 } ;
426428 self . push_event ( app, & e) ;
@@ -429,11 +431,11 @@ impl<S: 'static> OverlayBackend for GuiPanel<S> {
429431 if !pressed && !self . has_focus [ hit. pointer ] {
430432 let e = WguiEvent :: MouseMotion ( MouseMotionEvent {
431433 pos : vec2 ( -1. , -1. ) ,
432- device : hit. pointer ,
434+ device : DeviceBitmask :: from_usize ( hit. pointer ) ,
433435 } ) ;
434436 self . push_event ( app, & e) ;
435437 let e = WguiEvent :: MouseLeave ( MouseLeaveEvent {
436- device : hit. pointer ,
438+ device : DeviceBitmask :: from_usize ( hit. pointer ) ,
437439 } ) ;
438440 self . push_event ( app, & e) ;
439441 }
0 commit comments