summaryrefslogtreecommitdiffstats
path: root/src/widgets/desktop-widget.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-10-23 20:24:00 +0000
committerjabiertxof <info@marker.es>2016-10-23 20:24:00 +0000
commitfdb897947621a286ae05cd990e8663bb6c3dd907 (patch)
treec40f7bd8ab89412a00b3fab9a2bccd77003c3c01 /src/widgets/desktop-widget.cpp
parentAdd right click rotation panning, some fixes (diff)
downloadinkscape-fdb897947621a286ae05cd990e8663bb6c3dd907.tar.gz
inkscape-fdb897947621a286ae05cd990e8663bb6c3dd907.zip
Fix for widget value of rotate
(bzr r15142.1.24)
Diffstat (limited to 'src/widgets/desktop-widget.cpp')
-rw-r--r--src/widgets/desktop-widget.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 477414342..94abd23a9 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -66,6 +66,7 @@
#include <gtkmm/cssprovider.h>
#include <gtkmm/paned.h>
#include <gtkmm/messagedialog.h>
+#include <iomanip>
#if defined (SOLARIS) && (SOLARIS == 8)
#include "round.h"
@@ -1890,7 +1891,11 @@ sp_dtw_rotation_input (GtkSpinButton *spin, gdouble *new_val, gpointer /*data*/)
const gchar *b = gtk_entry_get_text (GTK_ENTRY (spin));
gdouble new_typed = atof (b);
- *new_val = new_typed;
+ if (new_scrolled == new_typed) { // the new value is set by scrolling
+ *new_val = new_scrolled;
+ } else { // the new value is typed in
+ *new_val = new_typed;
+ }
return TRUE;
}
@@ -1900,8 +1905,10 @@ sp_dtw_rotation_output (GtkSpinButton *spin, gpointer /*data*/)
{
gchar b[64];
double val = gtk_spin_button_get_value (spin);
- g_snprintf (b, 64, "%3.2fº", val);
- gtk_entry_set_text (GTK_ENTRY (spin), b);
+ std::ostringstream s;
+ s.imbue(std::locale(""));;
+ s << std::fixed << std::setprecision(2) << val << "º";
+ gtk_entry_set_text (GTK_ENTRY (spin), s.str().c_str());
return TRUE;
}