diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-measure-line.cpp | 11 | ||||
| -rw-r--r-- | src/ui/widget/registered-widget.cpp | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/live_effects/lpe-measure-line.cpp b/src/live_effects/lpe-measure-line.cpp index b84169480..80d8cb645 100644 --- a/src/live_effects/lpe-measure-line.cpp +++ b/src/live_effects/lpe-measure-line.cpp @@ -518,7 +518,7 @@ LPEMeasureLine::doBeforeEffect (SPLPEItem const* lpeitem) } //We get the font size to offset the text to the middle Pango::FontDescription fontdesc((Glib::ustring)fontbutton.param_getSVGValue()); - double fontsize = fontdesc.get_size()/Pango::SCALE; + double fontsize = fontdesc.get_size()/(double)Pango::SCALE; fontsize *= desktop->doc()->getRoot()->c2p.inverse().expansionX(); Geom::Coord angle_cross = std::fmod(angle + rad_from_deg(90), 2*M_PI); if (angle_cross < 0) angle_cross += 2*M_PI; @@ -541,13 +541,16 @@ LPEMeasureLine::doBeforeEffect (SPLPEItem const* lpeitem) } SPCSSAttr *css = sp_repr_css_attr_new(); sp_repr_css_attr_add_from_string(css, dimline_format.param_getSVGValue()); - gchar const * width_line = sp_repr_css_property(css,"stroke-width","-1"); - if (width_line != "-1") { - arrow_gap = 8 * atof(width_line); + std::setlocale(LC_NUMERIC, std::locale::classic().name().c_str()); + double width_line = atof(sp_repr_css_property(css,"stroke-width","-1")); + std::setlocale(LC_NUMERIC, std::locale("").name().c_str()); + if (width_line > -0.0001) { + arrow_gap = 8 * Inkscape::Util::Quantity::convert(width_line/ doc_scale, "mm", display_unit.c_str()); } if (flip_side) { arrow_gap *= -1; } + std::cout << arrow_gap << "arrow_gap\n"; angle_cross = std::fmod(angle + rad_from_deg(90), 2*M_PI); if (angle_cross < 0) angle_cross += 2*M_PI; hstart = hstart - Point::polar(angle_cross, position); diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 8b8bdc8e4..dc2e4e14a 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -351,7 +351,6 @@ RegisteredText::on_activate() Inkscape::SVGOStringStream os; os << str; write_to_xml(os.str().c_str()); - setText(os.str().c_str()); set_sensitive(true); _wr->setUpdating (false); } |
