diff --git a/processing/core/PGraphics.java b/processing/core/PGraphics.java index c6ffef713..621844a56 100644 --- a/processing/core/PGraphics.java +++ b/processing/core/PGraphics.java @@ -824,6 +824,14 @@ public class PGraphics extends PImage implements PConstants { y1 -= vradius; } + if (x1 > x2) { + float temp = x1; x1 = x2; x2 = temp; + } + + if (y1 > y2) { + float temp = y1; y1 = y2; y2 = temp; + } + rectImpl(x1, y1, x2, y2); } @@ -865,6 +873,16 @@ public class PGraphics extends PImage implements PConstants { y = b - d/2f; } + if (w < 0) { // undo negative width + x += w; + w = -w; + } + + if (h < 0) { // undo negative height + y += h; + h = -h; + } + ellipseImpl(x, y, w, h); } diff --git a/processing/core/todo.txt b/processing/core/todo.txt index bae5d475b..572541e4a 100644 --- a/processing/core/todo.txt +++ b/processing/core/todo.txt @@ -1,11 +1,13 @@ 0078 core -X text lines were getting horizontally mashed together -X text lines also getting vertically smashed together -X make a note of the change to font.width() +X text fixes +X lines were getting horizontally mashed together +X lines also getting vertically smashed together +X make a note of the change to font.width() +X backwards rects and backwards ellipses weren't properly drawn +X code now compensates for negative widths or swapped x1/x2 _ get SCREEN_SPACE text working again -_ backwards rects may not be getting drawn in PGraphics2 _ updatePixels() not setting PApplet.pixels _ also throwing NPEs