Skip to content

Commit d155033

Browse files
committed
fixes to svg for the new xml library
1 parent 9e3b984 commit d155033

6 files changed

Lines changed: 36 additions & 14 deletions

File tree

android/core/src/processing/core/PNode.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public PNode(Reader reader) {
101101
// Document document = builder.parse(dataPath("1_alt.html"));
102102
Document document = builder.parse(new InputSource(reader));
103103
node = document.getDocumentElement();
104+
name = node.getNodeName();
104105
// NodeList nodeList = document.getDocumentElement().getChildNodes();
105106
// for (int i = 0; i < nodeList.getLength(); i++) {
106107
// }

android/core/src/processing/core/PShapeSVG.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ protected PShape parseChild(PNode elem) {
309309
String name = elem.getName();
310310
PShapeSVG shape = null;
311311

312-
if (name.equals("g")) {
312+
if (name == null) {
313+
// just some whitespace that can be ignored (hopefully)
314+
315+
} else if (name.equals("g")) {
313316
//return new BaseObject(this, elem);
314317
shape = new PShapeSVG(this, elem, true);
315318

@@ -1690,7 +1693,9 @@ public Font(PShapeSVG parent, PNode properties) {
16901693
for (int i = 0; i < elements.length; i++) {
16911694
String name = elements[i].getName();
16921695
PNode elem = elements[i];
1693-
if (name.equals("glyph")) {
1696+
if (name == null) {
1697+
// skip it
1698+
} else if (name.equals("glyph")) {
16941699
FontGlyph fg = new FontGlyph(this, elem, this);
16951700
if (fg.isLegit()) {
16961701
if (fg.name != null) {

core/src/processing/core/PNode.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public PNode(Reader reader) {
105105
// Document document = builder.parse(dataPath("1_alt.html"));
106106
Document document = builder.parse(new InputSource(reader));
107107
node = document.getDocumentElement();
108+
name = node.getNodeName();
108109
// NodeList nodeList = document.getDocumentElement().getChildNodes();
109110
// for (int i = 0; i < nodeList.getLength(); i++) {
110111
// }

core/src/processing/core/PShapeSVG.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ protected PShape parseChild(PNode elem) {
317317
String name = elem.getName();
318318
PShapeSVG shape = null;
319319

320-
if (name.equals("g")) {
320+
if (name == null) {
321+
// just some whitespace that can be ignored (hopefully)
322+
323+
} else if (name.equals("g")) {
321324
//return new BaseObject(this, elem);
322325
shape = new PShapeSVG(this, elem, true);
323326

@@ -1658,7 +1661,9 @@ public Font(PShapeSVG parent, PNode properties) {
16581661
for (int i = 0; i < elements.length; i++) {
16591662
String name = elements[i].getName();
16601663
PNode elem = elements[i];
1661-
if (name.equals("glyph")) {
1664+
if (name == null) {
1665+
// skip it
1666+
} else if (name.equals("glyph")) {
16621667
FontGlyph fg = new FontGlyph(this, elem, this);
16631668
if (fg.isLegit()) {
16641669
if (fg.name != null) {

core/todo.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
0199 core
22
X pnode: look more closely at json and xml compatibility
33
X argh, dumb mistake that broke SVG loading with loadNode()
4+
X fix major XML loading problem with names not getting set
5+
X image saving also broken, saving duplicate images (adding .tif to em all)
6+
X make note about XML dealing with whitespace differently
7+
X leaves it intact, 'name' will be set to null
48

59

610
andres

todo.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
0199 pde
2-
2+
X remove error messages for UpdateCheck w/o internet connection
33

44
_ update to java 6u26
55

66
_ update the build instructions page
77
_ http://code.google.com/p/processing/wiki/BuildInstructions
88

9+
http://support.microsoft.com/kb/184082
10+
http://msdn.microsoft.com/en-us/library/cc144175%28v=VS.85%29.aspx
11+
http://msdn.microsoft.com/en-us/library/cc144104%28v=VS.85%29.aspx
12+
http://msdn.microsoft.com/en-us/library/cc144067%28v=VS.85%29.aspx
13+
In regedit: Navigate to Computer\HKEY_CLASSES_ROOT\Applications and find your .exe name. Navigate under its name to shell>open>command. In the Default change its location to the actual location of the executable, hit okay and then try and reassociate the file type as you normally would.
14+
_ problem with associating .pde files
15+
_ http://code.google.com/p/processing/issues/detail?id=247
16+
_ http://dev.processing.org/bugs/show_bug.cgi?id=1513
17+
_ do some testing for windows 7 on 64-bit
18+
_ http://dev.processing.org/bugs/show_bug.cgi?id=1424
19+
_ problem with startup on vista 64
20+
_ try this with windows 7 64-bit (install on laptop?)
21+
_ http://dev.processing.org/bugs/show_bug.cgi?id=1246
22+
923
_ switch to a non-modified version of the launcher exe
1024
_ move the launcher to jsmooth or something like that?
1125

@@ -21,6 +35,7 @@ _ lots of other things in the google code issues list
2135
_ does editor.bgcolor live in the theme.txt file for the mode?
2236
_ or should it be a user preference thing
2337
_ for that matter, need to decide on how much modes can customize themselves
38+
_ could move to java6 and better internal javac support (drop ecj)
2439

2540
_ how to catch these?
2641
Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: Could not initialize class javax.media.opengl.GLProfile
@@ -292,15 +307,6 @@ _ http://dev.processing.org/bugs/show_bug.cgi?id=1570
292307

293308
_ create default tools folder (just like libraries)
294309

295-
_ problem with associating .pde files
296-
_ http://code.google.com/p/processing/issues/detail?id=247
297-
_ http://dev.processing.org/bugs/show_bug.cgi?id=1513
298-
_ do some testing for windows 7 on 64-bit
299-
_ http://dev.processing.org/bugs/show_bug.cgi?id=1424
300-
_ problem with startup on vista 64
301-
_ try this with windows 7 64-bit (install on laptop?)
302-
_ http://dev.processing.org/bugs/show_bug.cgi?id=1246
303-
304310
_ add explanation to the reference about using beginRecord() with fonts
305311
_ pdf.textMode(SHAPE)
306312
_ also set the font *after* the record has started

0 commit comments

Comments
 (0)