From 10474ee5b50e0b0f9e9df8b73e597ec1e6130a8a Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Mon, 7 May 2012 15:03:17 +0200 Subject: Allow shorthand paths (bzr r11321.1.1) --- src/svg/path-string.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/svg/path-string.cpp') diff --git a/src/svg/path-string.cpp b/src/svg/path-string.cpp index 61e9c90a2..493d514d7 100644 --- a/src/svg/path-string.cpp +++ b/src/svg/path-string.cpp @@ -25,14 +25,17 @@ static int const maxprec = 16; int Inkscape::SVG::PathString::numericprecision; int Inkscape::SVG::PathString::minimumexponent; +double Inkscape::SVG::PathString::epsilon; Inkscape::SVG::PathString::PathString() : allow_relative_coordinates(Inkscape::Preferences::get()->getBool("/options/svgoutput/allowrelativecoordinates", true)), - force_repeat_commands(Inkscape::Preferences::get()->getBool("/options/svgoutput/forcerepeatcommands")) + force_repeat_commands(Inkscape::Preferences::get()->getBool("/options/svgoutput/forcerepeatcommands")), + allow_shorthands(Inkscape::Preferences::get()->getBool("/options/svgoutput/allowshorthands", true)) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); numericprecision = std::max(minprec,std::min(maxprec, prefs->getInt("/options/svgoutput/numericprecision", 8))); minimumexponent = prefs->getInt("/options/svgoutput/minimumexponent", -8); + epsilon = pow(10, -numericprecision+1); // The +1 is to give a bit more headroom when we have "low" values (we use relative error, while really we should look at digits, so a number starting with 1 requires a tolerance that's about 10 times higher). } void Inkscape::SVG::PathString::_appendOp(char abs_op, char rel_op) { -- cgit v1.2.3