fix for backwards rects and ellipses

This commit is contained in:
benfry
2005-03-02 22:17:47 +00:00
parent c7a4f54f57
commit 06f77be5df
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);
}