diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-06 14:43:33 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-06 14:53:29 -0400 |
commit | 69cc94ef23ea2b11c65a4c06e5e17aaea95a973e (patch) | |
tree | 1565003b44cdee61965bdfdf669348c9f60ebc38 /src/viewport.h | |
parent | 2ffd6edea17c1ec8fdb33d1135e27db0eb080625 (diff) | |
download | imv-69cc94ef23ea2b11c65a4c06e5e17aaea95a973e.tar.gz |
Prevent scrolling images indefinitely off-screen
With this change, if you scroll the image well beyond the viewport,
scrolling any amount in the other direction will immediately bring it
back on screen.
Diffstat (limited to 'src/viewport.h')
-rw-r--r-- | src/viewport.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/viewport.h b/src/viewport.h index d1803d4..9e1a13c 100644 --- a/src/viewport.h +++ b/src/viewport.h @@ -52,8 +52,10 @@ void imv_viewport_toggle_playing(struct imv_viewport *view); /* Reset the viewport to its initial settings */ void imv_viewport_reset(struct imv_viewport *view); -/* Pan the view by the given amounts */ -void imv_viewport_move(struct imv_viewport *view, int x, int y); +/* Pan the view by the given amounts without letting the texture get too far + * off-screen */ +void imv_viewport_move(struct imv_viewport *view, int x, int y, + const struct imv_texture *tex); /* Zoom the view by the given amount. imv_texture* is used to get the image * dimensions */ |