diff options
| author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2012-05-07 13:03:17 +0000 |
|---|---|---|
| committer | Jasper van de Gronde <th.v.d.gronde@hccnet.nl> | 2012-05-07 13:03:17 +0000 |
| commit | 10474ee5b50e0b0f9e9df8b73e597ec1e6130a8a (patch) | |
| tree | 532d445d71b2beee0be9396f4d31b8168bb34c50 /src/svg/path-string.cpp | |
| parent | C++ification of SPCtrlLine in preparation of visibility improvements. (diff) | |
| download | inkscape-10474ee5b50e0b0f9e9df8b73e597ec1e6130a8a.tar.gz inkscape-10474ee5b50e0b0f9e9df8b73e597ec1e6130a8a.zip | |
Allow shorthand paths
(bzr r11321.1.1)
Diffstat (limited to 'src/svg/path-string.cpp')
| -rw-r--r-- | src/svg/path-string.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<int>(minprec,std::min<int>(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) { |
