mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
clean up sync of constructor and load methods
This commit is contained in:
@@ -1076,7 +1076,7 @@ public class PGraphicsAndroid2D extends PGraphics {
|
||||
PShapeSVG svg = null;
|
||||
|
||||
if (extension.equals("svg")) {
|
||||
svg = new PShapeSVG(parent, filename);
|
||||
svg = new PShapeSVG(parent.loadXML(filename));
|
||||
|
||||
} else if (extension.equals("svgz")) {
|
||||
try {
|
||||
|
||||
@@ -151,14 +151,14 @@ public class PShapeSVG extends PShape {
|
||||
String fillName; // id of another object
|
||||
|
||||
|
||||
/**
|
||||
* Initializes a new SVG Object with the given filename.
|
||||
*/
|
||||
public PShapeSVG(PApplet parent, String filename) {
|
||||
// this will grab the root document, starting <svg ...>
|
||||
// the xml version and initial comments are ignored
|
||||
this(parent.loadXML(filename));
|
||||
}
|
||||
// /**
|
||||
// * Initializes a new SVG Object with the given filename.
|
||||
// */
|
||||
// public PShapeSVG(PApplet parent, String filename) {
|
||||
// // this will grab the root document, starting <svg ...>
|
||||
// // the xml version and initial comments are ignored
|
||||
// this(parent.loadXML(filename));
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@@ -206,7 +206,7 @@ public class PShapeSVG extends PShape {
|
||||
}
|
||||
|
||||
|
||||
public PShapeSVG(PShapeSVG parent, XML properties, boolean parseKids) {
|
||||
protected PShapeSVG(PShapeSVG parent, XML properties, boolean parseKids) {
|
||||
// Need to set this so that findChild() works.
|
||||
// Otherwise 'parent' is null until addChild() is called later.
|
||||
this.parent = parent;
|
||||
|
||||
@@ -248,7 +248,7 @@ public class PGraphics2D extends PGraphicsOpenGL {
|
||||
PShapeSVG svg = null;
|
||||
|
||||
if (extension.equals("svg")) {
|
||||
svg = new PShapeSVG(pg.parent, filename);
|
||||
svg = new PShapeSVG(pg.parent.loadXML(filename));
|
||||
|
||||
} else if (extension.equals("svgz")) {
|
||||
try {
|
||||
|
||||
@@ -106,6 +106,9 @@ _ and how it should be handled with hash/dict
|
||||
_ right now using hasKey().. in JSONObject
|
||||
|
||||
|
||||
_ add 'gz' as one of the loadXxx() options
|
||||
_ helps .svgz case from being weird, also generally dealing w/ compressed data
|
||||
|
||||
_ image caches not being properly disposed (weak references broken?)
|
||||
_ http://code.google.com/p/processing/issues/detail?id=1353
|
||||
|
||||
|
||||
Reference in New Issue
Block a user