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 28e85ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 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,12 @@ 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.x > bounds.x || image_bounds.y > bounds.y)
{
MouseCursor::Grab
} else {
MouseCursor::OutOfBounds
MouseCursor::Idle
}
},
)
Expand Down

0 comments on commit 28e85ba

Please sign in to comment.