=== modified file 'src/ui/widget/selected-style.cpp'
--- src/ui/widget/selected-style.cpp 2017-04-15 12:00:25 +0000
+++ src/ui/widget/selected-style.cpp 2017-04-17 11:30:34 +0000
@@ -1381,7 +1381,7 @@
double newval;
// by is -1..1
double max_f = 50; // maximum width is (current * max_f), minimum - zero
- newval = current * (std::exp(std::log(max_f-1) * (by+1)) - 1) / (max_f-2);
+ newval = current * (std::pow(max_f-1, by+1) - 1) / (max_f-2);
SPCSSAttr *css = sp_repr_css_attr_new ();
if (final && newval < 1e-6) {
@@ -1389,13 +1389,16 @@
// if it's not final, leave it a chance to increase again (which is not possible with "none")
sp_repr_css_set_property (css, "stroke", "none");
} else {
- newval = Inkscape::Util::Quantity::convert(newval, parent->_sw_unit, "px");
Inkscape::CSSOStringStream os;
- os << newval;
+ if (parent->getUnit()) {
+ os << Inkscape::Util::Quantity::convert(newval, parent->getUnit(), "px");
+ } else {
+ os << newval;
+ }
sp_repr_css_set_property (css, "stroke-width", os.str().c_str());
}
- sp_desktop_set_style (parent->getDesktop(), css);
+ sp_desktop_set_style (parent->getDesktop(), css, true);
sp_repr_css_attr_unref (css);
return newval - current;
}
@@ -1416,9 +1419,13 @@
if (modifier == 3) { // Alt, do nothing
} else {
double diff = value_adjust(startvalue, by, modifier, false);
+ gchar const *units = parent->getUnit() ? parent->getUnit()->abbr.c_str() : "px";
+ parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE,
+ _("Adjusting stroke width (%s): was %.3g, now %.3g (diff %.3g)"),
+ units, startvalue, startvalue + diff, diff);
+
DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey,
SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width")));
- parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting stroke width: was %.3g, now %.3g (diff %.3g)"), startvalue, startvalue + diff, diff);
}
}
@@ -1444,7 +1451,7 @@
void
RotateableStrokeWidth::do_scroll(double by, guint modifier) {
- do_motion(by/10.0, modifier);
+ do_motion(by/20.0, modifier);
startvalue_set = false;
}
=== modified file 'src/ui/widget/selected-style.h'
--- src/ui/widget/selected-style.h 2017-04-15 12:00:25 +0000
+++ src/ui/widget/selected-style.h 2017-04-17 11:37:38 +0000
@@ -123,6 +123,7 @@
void setDesktop(SPDesktop *desktop);
SPDesktop *getDesktop() {return _desktop;}
+ Inkscape::Util::Unit const *getUnit() {return _sw_unit;}
void update();
guint32 _lastselected[2];
@@ -131,7 +132,6 @@
guint _mode[2];
double current_stroke_width;
- Inkscape::Util::Unit const *_sw_unit; // points to object in UnitTable, do not delete
protected:
SPDesktop *_desktop;
@@ -272,6 +272,8 @@
void on_popup_preset(int i);
Gtk::MenuItem _popup_sw_remove;
+ Inkscape::Util::Unit const *_sw_unit; // points to object in UnitTable, do not delete
+
void *_drop[2];
bool _dropEnabled[2];
};