@@ -539,11 +539,9 @@ impl Widget for ImageViewer {
539539 // preventing rotated_image.area() from receiving them.
540540 // Position checks distinguish image vs. background interactions.
541541 match event. hits ( cx, self . view . area ( ) ) {
542- Hit :: FingerHoverIn ( he) => {
543- if rotated_image. area ( ) . rect ( cx) . contains ( he. abs ) {
544- self . mouse_cursor_hover_over_image = true ;
545- cx. set_cursor ( MouseCursor :: Hand ) ;
546- }
542+ Hit :: FingerHoverIn ( he) if rotated_image. area ( ) . rect ( cx) . contains ( he. abs ) => {
543+ self . mouse_cursor_hover_over_image = true ;
544+ cx. set_cursor ( MouseCursor :: Hand ) ;
547545 }
548546 Hit :: FingerHoverOut ( _) => {
549547 self . mouse_cursor_hover_over_image = false ;
@@ -576,22 +574,20 @@ impl Widget for ImageViewer {
576574 self . show_overlay_ui ( cx, true ) ;
577575 }
578576 }
579- Hit :: FingerDown ( fe) => {
580- if fe. is_primary_hit ( ) {
581- let click_pos = fe. abs ;
582- let on_image = rotated_image. area ( ) . rect ( cx) . contains ( click_pos) ;
583- let on_buttons = button_group_rounded_view. area ( ) . rect ( cx) . contains ( click_pos) ;
584- let on_metadata = self . view . view ( cx, ids ! ( metadata_rounded_view) )
585- . area ( ) . rect ( cx) . contains ( click_pos) ;
586- if on_image {
587- self . drag_state . drag_start = fe. abs ;
588- if self . drag_state . pan_offset . is_none ( ) {
589- self . drag_state . pan_offset = Some ( DVec2 :: default ( ) ) ;
590- }
591- } else if !on_buttons && !on_metadata {
592- self . reset ( cx) ;
593- cx. action ( ImageViewerAction :: Hide ) ;
577+ Hit :: FingerDown ( fe) if fe. is_primary_hit ( ) => {
578+ let click_pos = fe. abs ;
579+ let on_image = rotated_image. area ( ) . rect ( cx) . contains ( click_pos) ;
580+ let on_buttons = button_group_rounded_view. area ( ) . rect ( cx) . contains ( click_pos) ;
581+ let on_metadata = self . view . view ( cx, ids ! ( metadata_rounded_view) )
582+ . area ( ) . rect ( cx) . contains ( click_pos) ;
583+ if on_image {
584+ self . drag_state . drag_start = fe. abs ;
585+ if self . drag_state . pan_offset . is_none ( ) {
586+ self . drag_state . pan_offset = Some ( DVec2 :: default ( ) ) ;
594587 }
588+ } else if !on_buttons && !on_metadata {
589+ self . reset ( cx) ;
590+ cx. action ( ImageViewerAction :: Hide ) ;
595591 }
596592 }
597593 Hit :: FingerUp ( fe) if fe. is_over && fe. is_primary_hit ( ) => {
0 commit comments