summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d23636a)
raw | patch | inline | side by side (parent: d23636a)
author | jaspervdg <jaspervdg@users.sourceforge.net> | |
Mon, 28 Apr 2008 15:53:11 +0000 (15:53 +0000) | ||
committer | jaspervdg <jaspervdg@users.sourceforge.net> | |
Mon, 28 Apr 2008 15:53:11 +0000 (15:53 +0000) |
src/svg/gnome-canvas-bpath-util.cpp | patch | blob | history | |
src/svg/svg-path.cpp | patch | blob | history |
index ab67b20bef4d6a3349528edd227baee2edc10a48..49a4162fbc17eda0369393c4f39df36fdb855b09 100644 (file)
static bool isApproximatelyClosed(GnomeCanvasBpathDef *bpd) {
int const np = prefs_get_int_attribute("options.svgoutput", "numericprecision", 8);
- double const precision = pow(10.0, -np); // This roughly corresponds to a difference below the last significant digit
+ double const precision = 5*pow(10.0, -np); // 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;
// If it is approximately closed we close it here to prevent internal logic to fail.
// In addition it is probably better to continue working with this end point, as it
// is probably more precise than the original.
- // NOTE: At the very least sp_bpath_check_subpath will fail, but it is not unreasonable
- // to assume that there might be more places where similar problems would occur.
bpath[n_bpath-1].x3 = bpath[bpd->moveto_idx].x3;
bpath[n_bpath-1].y3 = bpath[bpd->moveto_idx].y3;
}
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp
index c645133a6477c8a3fb576ff6bb4427ac670b89f1..3823071b0dad3baf05b38bc939540bd381c582a1 100644 (file)
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
@@ -386,12 +386,14 @@ static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, bool final, const char
if (ctx->param == 0)
{
rsvg_bpath_def_closepath (ctx->bpath);
+ ctx->cpx = ctx->rpx = ctx->spx;
+ ctx->cpy = ctx->rpy = ctx->spy;
if (next_cmd != 0 && next_cmd != 'm') {
// This makes sure we do the right moveto if the closepath is followed by anything other than a moveto
ctx->cmd = 'm';
- ctx->params[0] = ctx->cpx = ctx->rpx = ctx->spx;
- ctx->params[1] = ctx->cpy = ctx->rpy = ctx->spy;
+ ctx->params[0] = ctx->cpx;
+ ctx->params[1] = ctx->cpy;
ctx->param = 2;
rsvg_parse_path_do_cmd(ctx, final, next_cmd);
}