summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9a7c80)
raw | patch | inline | side by side (parent: d9a7c80)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 2 Jan 2009 15:16:26 +0000 (15:16 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 2 Jan 2009 15:16:26 +0000 (15:16 +0000) |
src/livarot/Path.h | patch | blob | history | |
src/livarot/PathConversion.cpp | patch | blob | history | |
src/livarot/PathStroke.cpp | patch | blob | history |
diff --git a/src/livarot/Path.h b/src/livarot/Path.h
index b478449cdda7f9f955b25c2cb3a1c3961b81e6dc..102840d54ec77d1737e150715a38c7c018fe3fd5 100644 (file)
--- a/src/livarot/Path.h
+++ b/src/livarot/Path.h
// t=0 means it's at the start of the command's chunk, t=1 it's at the end
struct path_lineto
{
- path_lineto(bool m, Geom::Point pp) : isMoveTo(m), p(pp), piece(-1), t(0) {}
- path_lineto(bool m, Geom::Point pp, int pie, double tt) : isMoveTo(m), p(pp), piece(pie), t(tt) {}
+ path_lineto(bool m, Geom::Point pp) : isMoveTo(m), p(pp), piece(-1), t(0), closed(false) {}
+ path_lineto(bool m, Geom::Point pp, int pie, double tt) : isMoveTo(m), p(pp), piece(pie), t(tt), closed(false) {}
int isMoveTo;
Geom::Point p;
int piece;
double t;
+ bool closed; // true if subpath is closed (this point is the last point of a closed subpath)
};
std::vector<path_lineto> pts;
index 6ac6717afc40bc324a307f6fbdab3d1aeadee864..29cacb657d1257c20d8fe4714d113f7ce3dcfb39 100644 (file)
case descr_close: {
nextX = pts[lastMoveTo].p;
- AddPoint(nextX, curP, 1.0, false);
+ int n = AddPoint(nextX, curP, 1.0, false);
+ if (n > 0) pts[n].closed = true;
curP++;
break;
}
descr_cmd[curP]->associated = descr_cmd[curP - 1]->associated;
}
}
+ pts[descr_cmd[curP]->associated].closed = true;
curP++;
break;
}
nextX = nData->p;
lastMoveTo = AddPoint(nextX, true);
descr_cmd[curP]->associated = lastMoveTo;
+
last_point_relation = POINT_RELATION_TO_AREA(nextX, area);
start_elimination = false;
descr_cmd[curP]->associated = descr_cmd[curP - 1]->associated;
}
}
+ pts[descr_cmd[curP]->associated].closed = true;
last_point_relation = 0;
curP++;
break;
descr_cmd[curP]->associated = descr_cmd[curP - 1]->associated;
}
}
-
+ pts[descr_cmd[curP]->associated].closed = true;
curP++;
break;
}
index 5e952eff7c91a266589c56ac1fa65793c453074f..18cd050336e679cd34ee529cc71f963eee8cb93e 100644 (file)
if ( lastP > lastM+1 ) {
Geom::Point sbStart = pts[lastM].p;
Geom::Point sbEnd = pts[lastP - 1].p;
- if ( Geom::LInfty(sbEnd-sbStart) < 0.00001 ) { // why close lines that shouldn't be closed?
+ if ( pts[lastP - 1].closed /*Geom::LInfty(sbEnd-sbStart) < 0.00001 */ ) { // why close lines that shouldn't be closed?
// ah I see, because close is defined here for
// a whole path and should be defined per subpath.
// debut==fin => ferme (on devrait garder un element pour les close(), mais tant pis)