summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-bendpath.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-07-04 15:27:06 +0000
committerJaviertxo <jtx@jtx.marker.es>2013-07-04 15:27:06 +0000
commitb8ef835cd10460cf7548bae4970b395e9d7767d9 (patch)
tree12e14b42023385cf8bf8192c2ae482a4f59deff1 /src/live_effects/lpe-bendpath.cpp
parentIm not sure what changes are (diff)
parentShape calculations. do not quantize the coordinates. (Bug 168158) (diff)
downloadinkscape-b8ef835cd10460cf7548bae4970b395e9d7767d9.tar.gz
inkscape-b8ef835cd10460cf7548bae4970b395e9d7767d9.zip
Upadate to trunk
(bzr r11950.1.122)
Diffstat (limited to 'src/live_effects/lpe-bendpath.cpp')
-rw-r--r--src/live_effects/lpe-bendpath.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp
index 49660c91b..eaf9fe4a6 100644
--- a/src/live_effects/lpe-bendpath.cpp
+++ b/src/live_effects/lpe-bendpath.cpp
@@ -94,6 +94,10 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
bend_path.changed = false;
}
+ if (uskeleton.empty()) {
+ return pwd2_in; /// \todo or throw an exception instead? might be better to throw an exception so that the UI can display an error message or smth
+ }
+
D2<Piecewise<SBasis> > patternd2 = make_cuts_independent(pwd2_in);
Piecewise<SBasis> x = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[1]) : Piecewise<SBasis>(patternd2[0]);
Piecewise<SBasis> y = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[0]) : Piecewise<SBasis>(patternd2[1]);
@@ -105,9 +109,9 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
x-= bboxHorizontal.min();
y-= bboxVertical.middle();
- double scaling = uskeleton.cuts.back()/bboxHorizontal.extent();
+ double scaling = uskeleton.cuts.back()/bboxHorizontal.extent();
- if (scaling != 1.0) {
+ if (scaling != 1.0) {
x*=scaling;
}
@@ -117,7 +121,6 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
if (prop_scale != 1.0) y *= prop_scale;
}
-
Piecewise<D2<SBasis> > output = compose(uskeleton,x) + y*compose(n,x);
return output;
}