mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-29 01:34:56 +01:00
Avoid calling getters twice
This commit is contained in:
parent
71e9ed2df3
commit
b0b05d9aa1
1 changed files with 5 additions and 5 deletions
|
@ -158,11 +158,11 @@ page_is_visible(zathura_document_t *document, unsigned int page_number)
|
||||||
void
|
void
|
||||||
zathura_adjustment_set_value(GtkAdjustment* adjustment, gdouble value)
|
zathura_adjustment_set_value(GtkAdjustment* adjustment, gdouble value)
|
||||||
{
|
{
|
||||||
gtk_adjustment_set_value(adjustment,
|
const gdouble lower = gtk_adjustment_get_lower(adjustment);
|
||||||
MAX(gtk_adjustment_get_lower(adjustment),
|
const gdouble upper_m_size = gtk_adjustment_get_upper(adjustment) -
|
||||||
MIN(gtk_adjustment_get_upper(adjustment) -
|
gtk_adjustment_get_page_size(adjustment);
|
||||||
gtk_adjustment_get_page_size(adjustment),
|
|
||||||
value)));
|
gtk_adjustment_set_value(adjustment, MAX(lower, MIN(upper_m_size, value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
gdouble
|
gdouble
|
||||||
|
|
Loading…
Reference in a new issue