diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-08-01 16:11:45 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-08-01 16:11:45 +0000 |
| commit | b7556c8456244e9cc884f721d8a728c1377d565e (patch) | |
| tree | dfc8fd1a7f5358400b8c1b0c8a66ca1346799cd7 /src | |
| parent | Hide canvas text from some text input (diff) | |
| download | inkscape-b7556c8456244e9cc884f721d8a728c1377d565e.tar.gz inkscape-b7556c8456244e9cc884f721d8a728c1377d565e.zip | |
Noumerous bug fixes, font size, stroke with arroow position, and text input response
(bzr r15017.1.25)
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); } |
