From 48c6642a92ef1806df7db5905df6bbd744a07e30 Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 22 Nov 2008 23:53:46 +0000 Subject: [PATCH] bring back width/height in PShape --- core/src/processing/core/PShape.java | 36 +++++++++++++++---------- core/src/processing/core/PShapeSVG.java | 4 +-- core/todo.txt | 19 ++++++++----- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index caef62239..cf2274480 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -77,10 +77,12 @@ public class PShape implements PConstants { protected PImage image; // boundary box of this shape - protected float x; - protected float y; - protected float width; - protected float height; + //protected float x; + //protected float y; + //protected float width; + //protected float height; + public float width; + public float height; // set to false if the object is hidden in the layers palette protected boolean visible = true; @@ -216,23 +218,29 @@ public class PShape implements PConstants { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - protected void checkBounds() { - if (width == 0 || height == 0) { - // calculate bounds here (also take kids into account) - width = 1; - height = 1; - } - } +// protected void checkBounds() { +// if (width == 0 || height == 0) { +// // calculate bounds here (also take kids into account) +// width = 1; +// height = 1; +// } +// } + /** + * Get the width of the drawing area (not necessarily the shape boundary). + */ public float getWidth() { - checkBounds(); + //checkBounds(); return width; } + /** + * Get the height of the drawing area (not necessarily the shape boundary). + */ public float getHeight() { - checkBounds(); + //checkBounds(); return height; } @@ -521,7 +529,7 @@ public class PShape implements PConstants { } else { // coded set of vertices int index = 0; - + if (vertices[0].length == 2) { // drawing a 2D path for (int j = 0; j < vertexCodeCount; j++) { switch (vertexCodes[j]) { diff --git a/core/src/processing/core/PShapeSVG.java b/core/src/processing/core/PShapeSVG.java index 251afca48..3fce11082 100644 --- a/core/src/processing/core/PShapeSVG.java +++ b/core/src/processing/core/PShapeSVG.java @@ -1519,8 +1519,8 @@ public class PShapeSVG extends PShape { } // Set bounding box based on the parent bounding box if (found != null) { - found.x = this.x; - found.y = this.y; +// found.x = this.x; +// found.y = this.y; found.width = this.width; found.height = this.height; } diff --git a/core/todo.txt b/core/todo.txt index 9c85f1df5..3abd8e1f7 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -24,20 +24,27 @@ X Bring back CENTER_RADIUS but deprecate it X http://dev.processing.org/bugs/show_bug.cgi?id=1035 X enable smoothing by default in opengl X change hints to instead only be able to DISABLE 2X or 4X - -_ change reference re: smoothing in opengl -_ hint(), smooth(), and size() +X bring back .width and .height fields for PShape +o need to update the examples to reflect +X no examples to update +X change reference re: smoothing in opengl +X hint(), smooth(), and size() +_ rev the version number -_ OPENGL sketches flicker w/ Vista when background() is not used inside draw() -_ http://dev.processing.org/bugs/show_bug.cgi?id=930 -_ Disabling Aero scheme prevents the problem (maybe?) +_ do we need to do glEnable for multisample with gl? + _ Present mode and OPENGL not working in 0156 with Windows Vista _ http://dev.processing.org/bugs/show_bug.cgi?id=1009 _ Seems to be limited to Java 6u10 (but verify) _ -Dsun.java2d.d3d=false seems to fix the problem _ can probably add that to PApplet.main() +_ OPENGL sketches flicker w/ Vista when background() is not used inside draw() +_ http://dev.processing.org/bugs/show_bug.cgi?id=930 +_ Disabling Aero scheme sometimes prevents the problem +_ Updating graphics drivers may prevent the problem + _ No textures render with hint(ENABLE_ACCURATE_TEXTURES) _ http://dev.processing.org/bugs/show_bug.cgi?id=985 _ need to remove the hint from the reference