Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix rectMode() in 3D

  • Loading branch information...
commit c1855dd55b23c9b90e52bd73be2566d16a89427d 1 parent 558d58b
@jbuck authored
Showing with 65 additions and 0 deletions.
  1. +13 −0 processing.js
  2. +51 −0 test/ref/rectMode-3d.pde
  3. +1 −0  test/ref/tests.js
View
13 processing.js
@@ -13748,6 +13748,19 @@
throw "rect() with rounded corners is not supported in 3D mode";
}
+ if (curRectMode === PConstants.CORNERS) {
+ width -= x;
+ height -= y;
+ }
+ if (curRectMode === PConstants.RADIUS) {
+ width *= 2;
+ height *= 2;
+ }
+ if (curRectMode === PConstants.CENTER || curRectMode === PConstants.RADIUS) {
+ x -= width / 2;
+ y -= height / 2;
+ }
+
// Modeling transformation
var model = new PMatrix3D();
model.tr
View
51 test/ref/rectMode-3d.pde
51 additions, 0 deletions not shown
View
1  test/ref/tests.js
@@ -200,6 +200,7 @@ var tests = [
{ path: "continuous-curve.pde", tags: ["2D"], epsilonOverride: 0.09 },
{ path: "points-lines.pde", tags: ["2D", "Crisp"] },
{ path: "rectMode.pde", tags: ["2D", "Crisp"] },
+ { path: "rectMode-3d.pde", tags: ["3D"] },
{ path: "rect-quad.pde", tags: ["2D"] },
{ path: "size-fill-rect.pde", tags: ["2D"] },
{ path: "triangle.pde", tags: ["2D"] },
Please sign in to comment.
Something went wrong with that request. Please try again.