mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
address issue 515
This commit is contained in:
@@ -515,6 +515,7 @@ public class PShapeSVG extends PShape {
|
||||
|
||||
StringBuilder pathBuffer = new StringBuilder();
|
||||
boolean lastSeparate = false;
|
||||
boolean isOnDecimal = false;
|
||||
|
||||
for (int i = 0; i < pathDataChars.length; i++) {
|
||||
char c = pathDataChars[i];
|
||||
@@ -539,6 +540,13 @@ public class PShapeSVG extends PShape {
|
||||
if (c == 'Z' || c == 'z') {
|
||||
separate = false;
|
||||
}
|
||||
if (c == '.' && !isOnDecimal) {
|
||||
isOnDecimal = true;
|
||||
}
|
||||
else if (isOnDecimal && (c < '0' || c > '9')) {
|
||||
pathBuffer.append("|");
|
||||
isOnDecimal = c == '.';
|
||||
}
|
||||
if (c == '-' && !lastSeparate) {
|
||||
// allow for 'e' notation in numbers, e.g. 2.10e-9
|
||||
// https://download.processing.org/bugzilla/1408.html
|
||||
|
||||
Reference in New Issue
Block a user