diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-07-13 00:35:19 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-07-13 00:35:19 +0100 |
commit | 4473f6d8b7bda3ecb6acaf16e8609a219f7ef6fc (patch) | |
tree | beec9492b8a013ca7ad815ed1ea8a7691e5c7a2b /src/imv.c | |
parent | 5a1571d00dd1e73f906b1c83b7abe13aa0908e9a (diff) | |
download | imv-4473f6d8b7bda3ecb6acaf16e8609a219f7ef6fc.tar.gz |
Implement scroll input
Diffstat (limited to 'src/imv.c')
-rw-r--r-- | src/imv.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -455,6 +455,14 @@ static void event_handler(void *data, const struct imv_event *e) e->data.mouse_motion.dy, imv->current_image); } break; + case IMV_EVENT_MOUSE_SCROLL: + { + double x, y; + imv_window_get_mouse_position(imv->window, &x, &y); + imv_viewport_zoom(imv->view, imv->current_image, IMV_ZOOM_MOUSE, + x, y, -e->data.mouse_scroll.dy); + } + break; case IMV_EVENT_CUSTOM: consume_internal_event(imv, e->data.custom); break; @@ -464,15 +472,6 @@ static void event_handler(void *data, const struct imv_event *e) } -/* static void scroll_callback(GLFWwindow *window, double x, double y)*/ -/* {*/ -/* (void)x;*/ -/* struct imv *imv = glfwGetWindowUserPointer(window);*/ -/* imv_viewport_zoom(imv->view, imv->current_image, IMV_ZOOM_MOUSE,*/ -/* imv->last_cursor_position.x,*/ -/* imv->last_cursor_position.y, -y);*/ -/* }*/ - static void log_to_stderr(enum imv_log_level level, const char *text, void *data) { (void)data; |