Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. diff --git a/viewer/SDLview/sdl.c b/viewer/SDLview/sdl.c
  2. index fb96888..25f975f 100644
  3. --- a/viewer/SDLview/sdl.c
  4. +++ b/viewer/SDLview/sdl.c
  5. @@ -290,6 +290,14 @@ void checkSDLevent() {
  6. // rearm double click detection
  7. lastclickat = SDL_GetTicks();
  8. }
  9. + } else if (event.button.button == SDL_BUTTON_WHEELDOWN) {
  10. + zoom /= 1.2;
  11. + offset_x = display_x / 2 + (offset_x - display_x / 2) / 1.2;
  12. + offset_y = display_y / 2 + (offset_y - display_y / 2) / 1.2;
  13. + } else if (event.button.button == SDL_BUTTON_WHEELUP) {
  14. + zoom *= 1.2;
  15. + offset_x = display_x / 2 + (offset_x - display_x / 2) * 1.2;
  16. + offset_y = display_y / 2 + (offset_y - display_y / 2) * 1.2;
  17. } else {
  18. // disarm doubleclick detection
  19. lastclickat = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement