Some more clean up

This commit is contained in:
Sebastian Ramacher 2020-03-10 21:33:38 +01:00
parent b8e82e8f91
commit eab2479172
2 changed files with 4 additions and 4 deletions

View file

@ -131,7 +131,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* adjustment, gpointer data)
const double position_x = zathura_document_get_position_x(zathura->document); const double position_x = zathura_document_get_position_x(zathura->document);
const double position_y = zathura_adjustment_get_ratio(adjustment); const double position_y = zathura_adjustment_get_ratio(adjustment);
unsigned int page_id = position_to_page_number(zathura->document, position_x, position_y); const unsigned int page_id = position_to_page_number(zathura->document, position_x, position_y);
zathura_document_set_position_x(zathura->document, position_x); zathura_document_set_position_x(zathura->document, position_x);
zathura_document_set_position_y(zathura->document, position_y); zathura_document_set_position_y(zathura->document, position_y);

View file

@ -1124,9 +1124,9 @@ document_open(zathura_t* zathura, const char* path, const char* uri, const char*
GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment( GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(
GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view));
const unsigned int view_width = (unsigned int)floor(gtk_adjustment_get_page_size(hadjustment)); const unsigned int view_width = floor(gtk_adjustment_get_page_size(hadjustment));
zathura_document_set_viewport_width(zathura->document, view_width); zathura_document_set_viewport_width(zathura->document, view_width);
const unsigned int view_height = (unsigned int)floor(gtk_adjustment_get_page_size(vadjustment)); const unsigned int view_height = floor(gtk_adjustment_get_page_size(vadjustment));
zathura_document_set_viewport_height(zathura->document, view_height); zathura_document_set_viewport_height(zathura->document, view_height);
zathura_update_view_ppi(zathura); zathura_update_view_ppi(zathura);
@ -1135,7 +1135,7 @@ document_open(zathura_t* zathura, const char* path, const char* uri, const char*
cb_widget_screen_changed(zathura->ui.session->gtk.view, NULL, zathura); cb_widget_screen_changed(zathura->ui.session->gtk.view, NULL, zathura);
/* get initial device scale */ /* get initial device scale */
int device_factor = gtk_widget_get_scale_factor(zathura->ui.session->gtk.view); const int device_factor = gtk_widget_get_scale_factor(zathura->ui.session->gtk.view);
zathura_document_set_device_factors(zathura->document, device_factor, device_factor); zathura_document_set_device_factors(zathura->document, device_factor, device_factor);
/* create blank pages */ /* create blank pages */