summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-04-26 19:28:46 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2012-04-26 19:28:46 +0000
commitfa0dad91b01cfde47696d26323ec36d34e757db8 (patch)
tree9870b4ef0b31544f8539b195c2ca61a7c4218dca
parentpowerstroke: cautious fix. (diff)
downloadinkscape-fa0dad91b01cfde47696d26323ec36d34e757db8.tar.gz
inkscape-fa0dad91b01cfde47696d26323ec36d34e757db8.zip
2geom update
(bzr r11297)
-rw-r--r--src/2geom/piecewise.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h
index 837f33ea7..e3b4d3456 100644
--- a/src/2geom/piecewise.h
+++ b/src/2geom/piecewise.h
@@ -783,10 +783,13 @@ Piecewise<T> compose(Piecewise<T> const &f, SBasis const &g){
double t0=(*cut).first;
double t1=(*next).first;
- SBasis sub_g=compose(g, Linear(t0,t1));
- sub_g=compose(Linear(-f.cuts[idx]/(f.cuts[idx+1]-f.cuts[idx]),
- (1-f.cuts[idx])/(f.cuts[idx+1]-f.cuts[idx])),sub_g);
- result.push(compose(f[idx],sub_g),t1);
+ if (!are_near(t0,t1,EPSILON*EPSILON)) { // prevent adding cuts that are extremely close together and that may cause trouble with rounding e.g. when reversing the path
+ SBasis sub_g=compose(g, Linear(t0,t1));
+ sub_g=compose(Linear(-f.cuts[idx]/(f.cuts[idx+1]-f.cuts[idx]),
+ (1-f.cuts[idx])/(f.cuts[idx+1]-f.cuts[idx])),sub_g);
+ result.push(compose(f[idx],sub_g),t1);
+ }
+
cut++;
next++;
}