From 8821ce80b1139b0104439a9e87d8d8e6e3b0b595 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 22 Apr 2010 12:45:50 +0200 Subject: Partially fix zoom mode Does not yet work with initial zoom value != 100% --- src/winwidget.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/winwidget.h') diff --git a/src/winwidget.h b/src/winwidget.h index dd24f8f..8f03323 100644 --- a/src/winwidget.h +++ b/src/winwidget.h @@ -92,20 +92,27 @@ struct __winwidget { gib_list *file; unsigned char visible; - /* Stuff for zooming */ + /* panning, zooming, etc. */ unsigned char mode; - unsigned char caption_entry; /* are we in caption entry mode? */ + unsigned char caption_entry; + + /* image offset from window top left */ + int im_x; + int im_y; + + /* same, as cache for zoom mode */ + int orig_im_x; + int orig_im_y; + + /* From 0 (not visible) to 1.00 (actual size) + * all the way up to INT_MAX (eww) + */ + double zoom; + double old_zoom; - /* New stuff */ - int im_x; /* image offset from window top left */ - int im_y; /* image offset from window top left */ - double zoom; /* From 0 (not visible) to 1.00 (actual size) - all the way up to INT_MAX (ouch) */ int click_offset_x; int click_offset_y; - int im_click_offset_x; - int im_click_offset_y; unsigned char has_rotated; }; -- cgit v1.2.3