Skip to content

Commit

Permalink
Show idle cursor if image can't be panned
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah committed Apr 23, 2020
1 parent 0a365ad commit 224652a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wgpu/src/renderer/widget/image_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ impl image_pane::Renderer for Renderer {
{
if state.is_cursor_clicked() {
MouseCursor::Grabbing
} else if is_mouse_over {
} else if is_mouse_over
&& (image_bounds.width > bounds.width
|| image_bounds.height > bounds.height)
{
MouseCursor::Grab
} else {
MouseCursor::OutOfBounds
MouseCursor::Idle
}
},
)
Expand Down

0 comments on commit 224652a

Please sign in to comment.