diff --git a/zathura/adjustment.c b/zathura/adjustment.c index 06e84d3..b983571 100644 --- a/zathura/adjustment.c +++ b/zathura/adjustment.c @@ -158,11 +158,11 @@ page_is_visible(zathura_document_t *document, unsigned int page_number) void zathura_adjustment_set_value(GtkAdjustment* adjustment, gdouble value) { - gtk_adjustment_set_value(adjustment, - MAX(gtk_adjustment_get_lower(adjustment), - MIN(gtk_adjustment_get_upper(adjustment) - - gtk_adjustment_get_page_size(adjustment), - value))); + const gdouble lower = gtk_adjustment_get_lower(adjustment); + const gdouble upper_m_size = gtk_adjustment_get_upper(adjustment) - + gtk_adjustment_get_page_size(adjustment); + + gtk_adjustment_set_value(adjustment, MAX(lower, MIN(upper_m_size, value))); } gdouble