Honor the current zoom level.

Otherwise jump positions are off after changing the zoom level.
This commit is contained in:
Sebastian Ramacher 2012-09-02 00:44:58 +02:00
parent af04432892
commit e79a48452f
2 changed files with 7 additions and 5 deletions

View file

@ -637,13 +637,15 @@ sc_jumplist(girara_session_t* session, girara_argument_t* argument, girara_event
break;
}
page_set(zathura, jump->page);
position_set_delayed(zathura, jump->x, jump->y);
if (jump != NULL) {
page_set(zathura, jump->page);
const double s = zathura_document_get_scale(zathura->document);
position_set_delayed(zathura, jump->x * s, jump->y * s);
}
return false;
}
bool
sc_search(girara_session_t* session, girara_argument_t* argument,
girara_event_t* UNUSED(event), unsigned int UNUSED(t))

View file

@ -1130,7 +1130,7 @@ zathura_jumplist_save(zathura_t* zathura) {
GtkAdjustment* view_hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view));
cur->page = pagenum;
cur->x = gtk_adjustment_get_value(view_hadjustment);
cur->y = gtk_adjustment_get_value(view_vadjustment);
cur->x = gtk_adjustment_get_value(view_hadjustment) / zathura_document_get_scale(zathura->document);
cur->y = gtk_adjustment_get_value(view_vadjustment) / zathura_document_get_scale(zathura->document);;
}
}