summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-08-01 16:11:45 +0000
committerjabiertxof <info@marker.es>2016-08-01 16:11:45 +0000
commitb7556c8456244e9cc884f721d8a728c1377d565e (patch)
treedfc8fd1a7f5358400b8c1b0c8a66ca1346799cd7 /src/live_effects
parentHide canvas text from some text input (diff)
downloadinkscape-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/live_effects')
-rw-r--r--src/live_effects/lpe-measure-line.cpp11
1 files changed, 7 insertions, 4 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);