diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-11-19 18:20:47 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-11-19 18:20:47 +0000 |
| commit | 38816da8b2d99f6e4247d36a708add031d40020b (patch) | |
| tree | f8fe5574d34103b74e75eaa840d3a9d5b53f0288 /src/widgets/desktop-widget.cpp | |
| parent | Update translations for Khmer (diff) | |
| download | inkscape-38816da8b2d99f6e4247d36a708add031d40020b.tar.gz inkscape-38816da8b2d99f6e4247d36a708add031d40020b.zip | |
add one fractional digit to zooms less than 10%
(bzr r4113)
Diffstat (limited to 'src/widgets/desktop-widget.cpp')
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 79e6fd33c..51355b3e5 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1202,7 +1202,7 @@ bool SPDesktopWidget::onFocusInEvent(GdkEventFocus*) static gdouble sp_dtw_zoom_value_to_display (gdouble value) { - return floor (pow (2, value) * 100.0 + 0.5); + return floor (10 * (pow (2, value) * 100.0 + 0.05)) / 10; } static gdouble @@ -1231,7 +1231,12 @@ static bool sp_dtw_zoom_output (GtkSpinButton *spin, gpointer data) { gchar b[64]; - g_snprintf (b, 64, "%4.0f%%", sp_dtw_zoom_value_to_display (gtk_spin_button_get_value (spin))); + double val = sp_dtw_zoom_value_to_display (gtk_spin_button_get_value (spin)); + if (val < 10) { + g_snprintf (b, 64, "%4.1f%%", val); + } else { + g_snprintf (b, 64, "%4.0f%%", val); + } gtk_entry_set_text (GTK_ENTRY (spin), b); return TRUE; } |
