diff options
| author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2008-06-30 08:33:46 +0000 |
|---|---|---|
| committer | jaspervdg <jaspervdg@users.sourceforge.net> | 2008-06-30 08:33:46 +0000 |
| commit | f754c8e360b4380e21fd0fd627431b311e873f22 (patch) | |
| tree | 8c35926e1a6200056a99577a11a051f8b4b45cae /src | |
| parent | Initial cut of sliders in toolbars (diff) | |
| download | inkscape-f754c8e360b4380e21fd0fd627431b311e873f22.tar.gz inkscape-f754c8e360b4380e21fd0fd627431b311e873f22.zip | |
Approximately closed test for path parsing now looks at the absolute coordinate values again (in accordance with how PathString used to work before and relative coordinates, and how it works now).
(bzr r6097)
Diffstat (limited to 'src')
| -rw-r--r-- | src/svg/gnome-canvas-bpath-util.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/svg/gnome-canvas-bpath-util.cpp b/src/svg/gnome-canvas-bpath-util.cpp index 49a4162fb..5c94f1e1b 100644 --- a/src/svg/gnome-canvas-bpath-util.cpp +++ b/src/svg/gnome-canvas-bpath-util.cpp @@ -31,16 +31,13 @@ static inline NR::Point distTo(GnomeCanvasBpathDef *bpd, size_t idx1, size_t idx static bool isApproximatelyClosed(GnomeCanvasBpathDef *bpd) { int const np = prefs_get_int_attribute("options.svgoutput", "numericprecision", 8); - double const precision = 5*pow(10.0, -np); // This roughly corresponds to a difference below the last significant digit + double const precision = pow(10.0, -(np+1)); // This roughly corresponds to a difference below the last significant digit int const initial = bpd->moveto_idx; int const current = bpd->n_bpath - 1; - int const previous = bpd->n_bpath - 2; - NR::Point distToPrev(distTo(bpd, current, previous)); NR::Point distToInit(distTo(bpd, current, initial)); - // NOTE: It would be better to determine the uncertainty while parsing, in rsvg_parse_path_data, but this seems to perform reasonably well return - distToInit[NR::X] <= distToPrev[NR::X]*precision && - distToInit[NR::Y] <= distToPrev[NR::Y]*precision; + distToInit[NR::X] <= abs(bpd->bpath[current].c(3)[NR::X])*precision && + distToInit[NR::Y] <= abs(bpd->bpath[current].c(3)[NR::Y])*precision; } GnomeCanvasBpathDef * |
