diff options
author | Jonathan Blandford <jrb@redhat.com> | 2005-06-04 14:57:00 (GMT) |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2005-06-04 14:57:00 (GMT) |
commit | 1e52e37fcdfa46c0cc6e1ac9958cdde28ff7a629 (patch) | |
tree | 8d1f0fd45d2c9f56e708dcf0c1b1325e01d92c0e /shell/ev-view.c | |
parent | 3a5debb394dd45d4b802ab83e1249d9749fc4d84 (diff) |
other_page isn't necessarily page + 1.
Fri Jun 3 21:07:57 2005 Jonathan Blandford <jrb@redhat.com>
* shell/ev-view.c (get_page_extents): other_page isn't necessarily
page + 1.
* shell/ev-window.c: Make sure we add the timeout when we get a
focus-in event.
* shell/ev-view.c (view_set_adjustment_values): Add 0.5 to
adjustment->value before calculating the zoom factor to average
out all of our rounding errors. The page no longer 'drifts' when
resizing.
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r-- | shell/ev-view.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index 5b81ce3..20c0eef 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -422,14 +422,16 @@ view_set_adjustment_values (EvView *view, return; factor = 1.0; + /* We add 0.5 to the values before to average out our rounding errors. + */ switch (view->pending_scroll) { case SCROLL_TO_KEEP_POSITION: - factor = adjustment->value / adjustment->upper; + factor = (adjustment->value + 0.5) / adjustment->upper; break; case SCROLL_TO_CURRENT_PAGE: break; case SCROLL_TO_CENTER: - factor = (adjustment->value + adjustment->page_size * 0.5) / adjustment->upper; + factor = (adjustment->value + adjustment->page_size * 0.5 + 0.5) / adjustment->upper; break; } @@ -806,7 +808,7 @@ get_page_extents (EvView *view, /* First, we get the bounding box of the two pages */ if (other_page < ev_page_cache_get_n_pages (view->page_cache)) { ev_page_cache_get_size (view->page_cache, - page + 1, + other_page, view->scale, &width_2, &height_2); if (width_2 > width) |