You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
loadShape() problems with SVGs that have . starting a number in a path #518
Re-saving the SVG in 1.0 format with Illustrator instead of 1.1 will fix the issue, but the problem seems to be that a leading . in the SVG path code won't render properly, for instance:
M3,.6 – parse to M, 3, .6 (may be fixed with 9ef40ba)
M.6.7 – parse to M, .6, and .7
…etc
This caused a problem with the variable icons, which was fixed commit 805306f, so using the previous version of the SVGs should do the trick for testing.
Test code:
staticfinalString[] names = {
"array", "boolean", "byte", "char", "double", "float",
"integer", "long", "object", "short", "string"
};
voidsetup() {
size(250, 550);
textAlign(LEFT, CENTER);
textSize(24);
fill(0);
int each =50;
int pos =0;
for (String name : names) {
PShape s =loadShape(name +".svg");
shape(s, 0, pos, each, each);
text(name, 60, pos + each/2);
pos += each;
}
saveFrame("issue.png");
}
I worked with SVG files had also caused ArrayIndexOutOfBoundsException due to the parsing of the path data and in my case the exception was gone with Processing 4.2 , so It seems the fix for #515 also fixes #518 ? thanks @benfry for the fix
Activity
processing-bot commentedon Jul 31, 2022
Created by: benfry
This may be the same as #515
processing-bot commentedon Mar 8, 2023
Created by: haschdl
I worked with SVG files had also caused
ArrayIndexOutOfBoundsExceptiondue to the parsing of the path data and in my case the exception was gone with Processing 4.2 , so It seems the fix for #515 also fixes #518 ? thanks @benfry for the fix