What steps will reproduce the problem?
1. Attempt to view attached number8.svg file.
What is the expected output? What do you see instead?
Expect to see a regular number 8 displayed. Last two paths of figure 8 are
closed wrongly causing a cross over on lower loop.
What version of the product are you using? On what operating system?
svgAndroid2.12Dec2011.jar (with additional patches - see other issues by me).
Android 2.3.3 Emulated.
Please provide any additional information below.
Need to track initial coord of contour so that lastX and lastY can be updated
when contour is closed.
Need to manually close because android.graphics.path will curve the closure
whereas SVG expects a straight line.
Patch:
Add variables to track initial contour coord:
float contourInitialX = 0;
float contourInitialY = 0;
Update these whenever a new contour is started by a 'm' command:
case 'M':
case 'm': {
float x = ph.nextFloat();
float y = ph.nextFloat();
if (cmd == 'm') {
p.rMoveTo(x, y);
lastX += x;
lastY += y;
} else {
p.moveTo(x, y);
lastX = x;
lastY = y;
}
contourInitialX = lastX;
contourInitialY = lastY;
break;
}
Close the path manually and update lastX and lastY:
case 'Z':
case 'z': {
p.lineTo(contourInitialX, contourInitialY);
p.close();
lastX = contourInitialX;
lastY = contourInitialY;
break;
}
Original issue reported on code.google.com by t...@vokware.com on 18 Apr 2012 at 4:29
Original issue reported on code.google.com by
t...@vokware.com
on 18 Apr 2012 at 4:29Attachments: