summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 627de6e)
raw | patch | inline | side by side (parent: 627de6e)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 3 Dec 2007 18:41:40 +0000 (18:41 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Mon, 3 Dec 2007 18:41:40 +0000 (18:41 +0000) |
src/sp-shape.cpp | patch | blob | history |
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index a0c2249c7dd8d43100d35c0afe6d5cb73b5d4b47..488dd9993e221e165339d17cd33071a17775a8bf 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
b++;
// Cycle through the subsequent nodes in the path
- while (b->code != NR_END) {
+ while (b->code == NR_LINETO || b->code == NR_CURVETO) {
pos = b->c(3) * i2d; // this is the current node
- g_assert(b->code == NR_LINETO || b->code == NR_CURVETO);
- g_assert(b[1].code == NR_LINETO || b[1].code == NR_CURVETO || b[1].code == NR_END);
-
if (b->code == NR_LINETO || b[1].code == NR_LINETO || b[1].code == NR_END) {
// end points of a line segment are always considered for snapping
*p = pos;
} else {
NR::Point ppos, npos;
- ppos = b->c(2) * i2d; // backward handle
- npos = b[1].c(1) * i2d; // forward handle
+ ppos = b->code == NR_CURVETO ? b->c(2) * i2d : pos; // backward handle
+ npos = b[1].code == NR_CURVETO ? b[1].c(1) * i2d : pos; // forward handle
// Determine whether a node is at a smooth part of the path, by
// calculating a measure for the collinearity of the handles