Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2005-09-08 11:59:55 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-09-08 11:59:55 (GMT)
commit9832f65434f957b1374d07e6a645b6b8ac88f459 (patch)
tree00ec7541bb507f1f41449b2f42367a5e523025e4 /shell
parentb1248719129d11eee34d3e3ce43f1a85b883b83c (diff)
Fix some bugs with xyz links, respect zoom
2005-09-08 Marco Pesenti Gritti <mpg@redhat.com> * backend/ev-link.c: (ev_link_new_page_xyz): * pdf/ev-poppler.cc: * shell/ev-view.c: (goto_xyz_link), (ev_view_goto_link): Fix some bugs with xyz links, respect zoom
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index 49b0be6..7957b73 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -1091,16 +1091,25 @@ get_link_at_location (EvView *view,
}
static void
-scroll_to_xyz_link (EvView *view, EvLink *link)
+goto_xyz_link (EvView *view, EvLink *link)
{
GdkPoint view_point;
EvPoint doc_point;
+ int height, page;
+ double zoom;
- doc_point.x = ev_link_get_left (link);
- doc_point.y = ev_link_get_top (link);
+ zoom = ev_link_get_zoom (link);
+ page = ev_link_get_page (link);
+ ev_page_cache_get_size (view->page_cache, page, 0, 1.0, NULL, &height);
+
+ ev_view_set_sizing_mode (view, EV_SIZING_FREE);
+ if (zoom != 0) {
+ ev_view_set_zoom (view, zoom, FALSE);
+ }
- doc_point_to_view_point (view, ev_link_get_page (link),
- &doc_point, &view_point);
+ doc_point.x = ev_link_get_left (link);
+ doc_point.y = height - ev_link_get_top (link);
+ doc_point_to_view_point (view, page, &doc_point, &view_point);
gtk_adjustment_set_value (view->hadjustment, view_point.x);
gtk_adjustment_set_value (view->vadjustment, view_point.y);
@@ -1123,7 +1132,7 @@ ev_view_goto_link (EvView *view, EvLink *link)
ev_page_cache_set_current_page (view->page_cache, page);
break;
case EV_LINK_TYPE_PAGE_XYZ:
- scroll_to_xyz_link (view, link);
+ goto_xyz_link (view, link);
break;
case EV_LINK_TYPE_EXTERNAL_URI:
uri = ev_link_get_uri (link);