File tree Expand file tree Collapse file tree
plugin-canvas/src/platform/win32 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,23 +46,27 @@ impl OsWindow {
4646 }
4747
4848 fn button_down ( & self , button : MouseButton , position : LogicalPosition ) {
49- let mut buttons_down = self . buttons_down . borrow_mut ( ) ;
50- if buttons_down. is_empty ( ) {
51- unsafe { SetCapture ( self . hwnd ( ) ) ; }
52- }
49+ {
50+ let mut buttons_down = self . buttons_down . borrow_mut ( ) ;
51+ if buttons_down. is_empty ( ) {
52+ unsafe { SetCapture ( self . hwnd ( ) ) ; }
53+ }
5354
54- buttons_down. insert ( button) ;
55+ buttons_down. insert ( button) ;
56+ }
5557
5658 * self . last_mouse_position . borrow_mut ( ) = position. clone ( ) ;
5759 self . send_event ( Event :: MouseButtonDown { button, position } ) ;
5860 }
5961
6062 fn button_up ( & self , button : MouseButton , position : LogicalPosition ) {
61- let mut buttons_down = self . buttons_down . borrow_mut ( ) ;
62- buttons_down. remove ( & button) ;
63+ {
64+ let mut buttons_down = self . buttons_down . borrow_mut ( ) ;
65+ buttons_down. remove ( & button) ;
6366
64- if buttons_down. is_empty ( ) {
65- unsafe { SetCapture ( HWND ( null_mut ( ) ) ) ; }
67+ if buttons_down. is_empty ( ) {
68+ unsafe { SetCapture ( HWND ( null_mut ( ) ) ) ; }
69+ }
6670 }
6771
6872 * self . last_mouse_position . borrow_mut ( ) = position. clone ( ) ;
You can’t perform that action at this time.
0 commit comments