summaryrefslogtreecommitdiffstats
path: root/src/livarot/PathConversion.cpp
diff options
context:
space:
mode:
authorAndrius Ramanauskas <knutux@gmail.com>2006-05-16 05:17:46 +0000
committerknutux <knutux@users.sourceforge.net>2006-05-16 05:17:46 +0000
commita0f0266795905f63766759eb9071dd7b3195f7ab (patch)
tree2ef050ddba5e706e9b6b1daaba14b1cf933f26ce /src/livarot/PathConversion.cpp
parentoptionally use linear profile for sculpting (diff)
downloadinkscape-a0f0266795905f63766759eb9071dd7b3195f7ab.tar.gz
inkscape-a0f0266795905f63766759eb9071dd7b3195f7ab.zip
Bug 1488621 (path misrendered if some successive node is in the same position)
(bzr r852)
Diffstat (limited to 'src/livarot/PathConversion.cpp')
-rw-r--r--src/livarot/PathConversion.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/livarot/PathConversion.cpp b/src/livarot/PathConversion.cpp
index a45e7548a..7c741ac4c 100644
--- a/src/livarot/PathConversion.cpp
+++ b/src/livarot/PathConversion.cpp
@@ -423,10 +423,11 @@ void Path::Convert(NRRectL *area, double treshhold)
int lastMoveTo = 0;
short last_point_relation = 0;
short curent_point_relation = 0;
+ bool last_start_elimination = false;
bool start_elimination = false;
bool replace = false;
- // le moveto
+ // first point
{
int const firstTyp = descr_cmd[0]->getType();
if ( firstTyp == descr_moveto ) {
@@ -441,7 +442,7 @@ void Path::Convert(NRRectL *area, double treshhold)
}
descr_cmd[0]->associated = lastMoveTo;
- // et le reste, 1 par 1
+ // process nodes one by one
while ( curP < int(descr_cmd.size()) ) {
int const nType = descr_cmd[curP]->getType();
@@ -487,6 +488,7 @@ void Path::Convert(NRRectL *area, double treshhold)
nextX = nData->p;
curent_point_relation = POINT_RELATION_TO_AREA(nextX, area);
replace = false;
+ last_start_elimination = start_elimination;
if (curent_point_relation > 0 && curent_point_relation == last_point_relation) {
if (!start_elimination) {
start_elimination = true;
@@ -503,6 +505,8 @@ void Path::Convert(NRRectL *area, double treshhold)
}
if ( descr_cmd[curP]->associated < 0 ) {
+ // point is not added as position is equal to the last added
+ start_elimination = last_start_elimination;
if ( curP == 0 ) {
descr_cmd[curP]->associated = 0;
} else {
@@ -520,6 +524,7 @@ void Path::Convert(NRRectL *area, double treshhold)
curent_point_relation = POINT_RELATION_TO_AREA(nextX, area);
replace = false;
+ last_start_elimination = start_elimination;
if (curent_point_relation > 0 && curent_point_relation == last_point_relation &&
curent_point_relation == POINT_RELATION_TO_AREA(curX + (nData->start), area) &&
curent_point_relation == POINT_RELATION_TO_AREA(nextX + (nData->end), area))
@@ -540,6 +545,8 @@ void Path::Convert(NRRectL *area, double treshhold)
}
if ( descr_cmd[curP]->associated < 0 ) {
+ // point is not added as position is equal to the last added
+ start_elimination = last_start_elimination;
if ( curP == 0 ) {
descr_cmd[curP]->associated = 0;
} else {