Skip to content

Commit

Permalink
Refined zoom step
Browse files Browse the repository at this point in the history
I would give the credentials to the orignal author but he is only known
as "unqwist".

Closes #359.
  • Loading branch information
mowgli committed May 19, 2016
1 parent a9ce4ed commit f282fd9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,8 +1404,8 @@ gchar *image_zoom_get_as_text(ImageWindow *imd)
approx = "~";
}

if (rint(l) != l) pl = 1;
if (rint(r) != r) pr = 1;
if (rint(l) != l) pl = 2;
if (rint(r) != r) pr = 2;

return g_strdup_printf("%.*f :%s%.*f", pl, l, approx, pr, r);
}
Expand Down
2 changes: 1 addition & 1 deletion src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

gdouble get_zoom_increment(void)
{
return ((options->image.zoom_increment != 0) ? (gdouble)options->image.zoom_increment / 10.0 : 1.0);
return ((options->image.zoom_increment != 0) ? (gdouble)options->image.zoom_increment / 100.0 : 1.0);
}

gchar *utf8_validate_or_convert(const gchar *text)
Expand Down
2 changes: 1 addition & 1 deletion src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct _ConfOptions
gboolean zoom_2pass;
gboolean zoom_to_fit_allow_expand;
guint zoom_quality;
gint zoom_increment; /* 10 is 1.0, 5 is 0.05, 20 is 2.0, etc. */
gint zoom_increment; /* 100 is 1.0, 5 is 0.05, 200 is 2.0, etc. */
gboolean use_clutter_renderer;

gboolean use_custom_border_color_in_fullscreen;
Expand Down
4 changes: 2 additions & 2 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static void scroll_reset_cb(GtkWidget *widget, gpointer data)

static void zoom_increment_cb(GtkWidget *spin, gpointer data)
{
c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 10.0 + 0.01);
c_options->image.zoom_increment = (gint)(gtk_spin_button_get_value(GTK_SPIN_BUTTON(spin)) * 100.0 + 0.01);
}

static void slideshow_delay_cb(GtkWidget *spin, gpointer data)
Expand Down Expand Up @@ -1400,7 +1400,7 @@ static void config_tab_image(GtkWidget *notebook)

c_options->image.zoom_increment = options->image.zoom_increment;
spin = pref_spin_new(group, _("Zoom increment:"), NULL,
0.1, 4.0, 0.1, 1, (gdouble)options->image.zoom_increment / 10.0,
0.01, 4.0, 0.01, 2, (gdouble)options->image.zoom_increment / 100.0,
G_CALLBACK(zoom_increment_cb), NULL);
gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_ALWAYS);

Expand Down

0 comments on commit f282fd9

Please sign in to comment.