diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-04-13 01:33:31 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-04-13 01:33:31 +0000 |
| commit | 1f878b666eabc935a6578f80d4a2384974c90073 (patch) | |
| tree | c10a1ca67974850a0107925933c7da93567f8f91 /src | |
| parent | Add keyboard binding for Paint Bucket and Set Clipping Path (diff) | |
| download | inkscape-1f878b666eabc935a6578f80d4a2384974c90073.tar.gz inkscape-1f878b666eabc935a6578f80d4a2384974c90073.zip | |
fix thinning that didn't work for paths inside a transformed group
(bzr r2871)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dyna-draw-context.cpp | 7 | ||||
| -rw-r--r-- | src/livarot/Shape.h | 2 | ||||
| -rw-r--r-- | src/livarot/ShapeMisc.cpp | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index ad8d18442..6925960ea 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -669,10 +669,11 @@ sp_ddc_dilate (SPDynaDrawContext *dc, NR::Point p, bool expand) } bool did_this = false; + NR::Matrix i2doc(sp_item_i2doc_affine(item)); if (theShape->MakeOffset(theRes, - expand? offset : -offset, - join_straight, butt_straight, - true, p[NR::X], p[NR::Y], radius) == 0) // 0 means the shape was actually changed + expand? offset : -offset, + join_straight, butt_straight, + true, p[NR::X], p[NR::Y], radius, &i2doc) == 0) // 0 means the shape was actually changed did_this = true; // the rest only makes sense if we actually changed the path diff --git a/src/livarot/Shape.h b/src/livarot/Shape.h index 42069f623..80a4d8c09 100644 --- a/src/livarot/Shape.h +++ b/src/livarot/Shape.h @@ -281,7 +281,7 @@ public: // create a graph that is an offseted version of the graph "of" // the offset is dec, with joins between edges of type "join" (see LivarotDefs.h) // the result is NOT a polygon; you need a subsequent call to ConvertToShape to get a real polygon - int MakeOffset(Shape *of, double dec, JoinType join, double miter, bool do_profile=false, double cx = 0, double cy = 0, double radius = 0); + int MakeOffset(Shape *of, double dec, JoinType join, double miter, bool do_profile=false, double cx = 0, double cy = 0, double radius = 0, NR::Matrix *i2doc = NULL); int PtWinding(const NR::Point px) const; // plus rapide int Winding(const NR::Point px) const; diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp index ec93d1d90..b269c1c9c 100644 --- a/src/livarot/ShapeMisc.cpp +++ b/src/livarot/ShapeMisc.cpp @@ -528,7 +528,7 @@ Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int wildPath,in // you gotta be very careful with the join, as anything but the right one will fuck everything up // see PathStroke.cpp for the "right" joins int -Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_profile, double cx, double cy, double radius) +Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_profile, double cx, double cy, double radius, NR::Matrix *i2doc) { Reset (0, 0); MakeBackData(a->_has_back_data); @@ -606,9 +606,9 @@ Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_p ptP = a->getPoint(a->getEdge(i).st).x; double this_dec; - if (do_profile) { + if (do_profile && i2doc) { double alpha = 1; - double x = (NR::L2(ptP - NR::Point(cx,cy))/radius); + double x = (NR::L2(ptP * (*i2doc) - NR::Point(cx,cy))/radius); if (x > 1) { this_dec = 0; } else if (x <= 0) { |
