diff options
| author | Josh Andler <scislac@gmail.com> | 2009-09-26 20:11:28 +0000 |
|---|---|---|
| committer | scislac <scislac@users.sourceforge.net> | 2009-09-26 20:11:28 +0000 |
| commit | 257bd68e4d262a5432f6cb1f6fed88d46512a4ca (patch) | |
| tree | 569c8119af33c2a090f070d1736dff955c3fca1b /src/live_effects/lpe-bendpath.cpp | |
| parent | Patch by Adib for 248721. Thanks Adib! (diff) | |
| download | inkscape-257bd68e4d262a5432f6cb1f6fed88d46512a4ca.tar.gz inkscape-257bd68e4d262a5432f6cb1f6fed88d46512a4ca.zip | |
Fix by Johan for 436304.
(bzr r8651)
Diffstat (limited to 'src/live_effects/lpe-bendpath.cpp')
| -rw-r--r-- | src/live_effects/lpe-bendpath.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index a820fe478..bc8477829 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -35,7 +35,7 @@ B is a map t --> B(t) = ( a(t), b(t) ). The first step is to re-parametrize B by its arc length: this is the parametrization in which a point p on B is located by its distance s from start. One obtains a new map s --> U(s) = (a'(s),b'(s)), that still describes the same path B, but where the distance along B from start to U(s) is s itself. -We also need a unit normal to the path. This can be obtained by computing a unit tangent vector, and rotate it by 90°. Call this normal vector N(s). +We also need a unit normal to the path. This can be obtained by computing a unit tangent vector, and rotate it by 90�. Call this normal vector N(s). The basic deformation associated to B is then given by: @@ -100,11 +100,14 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd 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]); -//We use the group bounding box size or the path bbox size to translate well x and y - x-= vertical_pattern.get_value() ? boundingbox_Y.min() : boundingbox_X.min(); - y-= vertical_pattern.get_value() ? boundingbox_X.middle() : boundingbox_Y.middle(); + Interval bboxHorizontal = vertical_pattern.get_value() ? boundingbox_Y : boundingbox_X; + Interval bboxVertical = vertical_pattern.get_value() ? boundingbox_X : boundingbox_Y; - double scaling = uskeleton.cuts.back()/boundingbox_X.extent(); + //We use the group bounding box size or the path bbox size to translate well x and y + x-= bboxHorizontal.min(); + y-= bboxVertical.middle(); + + double scaling = uskeleton.cuts.back()/bboxHorizontal.extent(); if (scaling != 1.0) { x*=scaling; |
