fix for backwards rects and ellipses

This commit is contained in:
benfry
2005-03-02 22:17:47 +00:00
parent 0d030573c5
commit e00a52589c
2 changed files with 24 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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