summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2c70b37)
raw | patch | inline | side by side (parent: 2c70b37)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 13 Apr 2007 01:33:31 +0000 (01:33 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 13 Apr 2007 01:33:31 +0000 (01:33 +0000) |
src/dyna-draw-context.cpp | patch | blob | history | |
src/livarot/Shape.h | patch | blob | history | |
src/livarot/ShapeMisc.cpp | patch | blob | history |
index ad8d18442ce684ae7288e9e50a9bafd7342635bd..6925960ea7eccb4e06dc9e8e8f3e727981e1a012 100644 (file)
}
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 42069f62346ab2c3e508e7aabbe5fb34ef23cab1..80a4d8c09e229e66520f5266d8635404286da958 100644 (file)
--- a/src/livarot/Shape.h
+++ b/src/livarot/Shape.h
// 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;
index ec93d1d9093a17011c8d080e720abd2aefd2e975..b269c1c9cf8dcfb6bd7b321f5d75cf3a7cd2d2ba 100644 (file)
@@ -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) {