From: nicholasbishop Date: Thu, 26 Jul 2007 09:08:25 +0000 (+0000) Subject: SpinSlider: X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=68991a79a8befd84ef9af0fd4ee9922e149c5205;p=inkscape.git SpinSlider: If the digits value is set to zero, truncate the value when setting the attribute so it is an int, rather than a double. --- diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp index a76f1db49..311d09963 100644 --- a/src/ui/widget/spin-slider.cpp +++ b/src/ui/widget/spin-slider.cpp @@ -32,7 +32,12 @@ SpinSlider::SpinSlider(double value, double lower, double upper, double step_inc Glib::ustring SpinSlider::get_as_attribute() const { - return Glib::Ascii::dtostr((int)_adjustment.get_value()); + const double val = _adjustment.get_value(); + + if(_spin.get_digits() == 0) + return Glib::Ascii::dtostr((int)val); + else + return Glib::Ascii::dtostr(val); } void SpinSlider::set_from_attribute(SPObject* o)