diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 9540cf67b..e57fa6039 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -258,20 +258,6 @@ public class PShape implements PConstants { protected void pre(PGraphics g) { if (matrix != null) { - /* - boolean flat = g instanceof PGraphics2D; - - g.pushMatrix(); - if (flat) { - g.applyMatrix(matrix.m00, matrix.m01, matrix.m03, // PMatrix3D - matrix.m10, matrix.m11, matrix.m13); - } else { - g.applyMatrix(matrix.m00, matrix.m01, matrix.m02, matrix.m03, - matrix.m10, matrix.m11, matrix.m12, matrix.m13, - matrix.m20, matrix.m21, matrix.m22, matrix.m23, - matrix.m30, matrix.m31, matrix.m32, matrix.m33); - } - */ g.pushMatrix(); g.applyMatrix(matrix); } @@ -290,8 +276,8 @@ public class PShape implements PConstants { ellipseModeSaved = g.ellipseMode; shapeModeSaved = g.shapeMode; */ - g.pushStyle(); if (style) { + g.pushStyle(); styles(g); } } @@ -337,11 +323,14 @@ public class PShape implements PConstants { g.ellipseMode = ellipseModeSaved; */ - g.popStyle(); if (matrix != null) { g.popMatrix(); } + + if (style) { + g.popStyle(); + } } @@ -351,7 +340,6 @@ public class PShape implements PConstants { * shape(s); */ public void draw(PGraphics g) { - //System.out.println("drawing " + getClass().getName()); if (visible) { pre(g); drawImpl(g); @@ -514,6 +502,10 @@ public class PShape implements PConstants { protected void drawPath(PGraphics g) { + // Paths might be empty (go figure) + // http://dev.processing.org/bugs/show_bug.cgi?id=982 + if (vertices == null) return; + g.beginShape(); int index = 0; diff --git a/core/src/processing/core/PShapeSVG.java b/core/src/processing/core/PShapeSVG.java index 76c949449..a57bce77d 100644 --- a/core/src/processing/core/PShapeSVG.java +++ b/core/src/processing/core/PShapeSVG.java @@ -758,8 +758,7 @@ public class PShapeSVG extends PShape { System.err.println("Could not parse transform " + matrixStr); return null; } - float[] m = PApplet.parseFloat(PApplet.splitTokens(pieces[2])); - + float[] m = PApplet.parseFloat(PApplet.splitTokens(pieces[2], ", ")); if (pieces[1].equals("matrix")) { return new PMatrix2D(m[0], m[2], m[4], m[1], m[3], m[5]); diff --git a/todo.txt b/todo.txt index 136617bcd..89358b30d 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,9 @@ 0155 pde - +X "Save canceled" message when saving untitled sketches without first renaming +X http://dev.processing.org/bugs/show_bug.cgi?id=987 +X when saving a sketch over itself with "Save As", just do "Save" instead +X fix loadShape() transformation parsing and empty paths (thanks ricardmp) +X http://dev.processing.org/bugs/show_bug.cgi?id=982 _ move library examples to the examples menu _ do this once the library documentation has been fixed up