From 8e20a17db5d6f3bb3e6b944ccbc03364c1f28d49 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 8 Jun 2015 13:54:34 -0400 Subject: [PATCH] deal with wise guys --- core/src/processing/core/PApplet.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 1c680709e..9ee71c4aa 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -39,6 +39,7 @@ import java.awt.Toolkit; import java.awt.color.ColorSpace; import java.awt.image.BufferedImage; + // used by loadImage() functions import javax.imageio.ImageIO; import javax.swing.ImageIcon; @@ -1041,6 +1042,9 @@ public class PApplet implements PConstants { public void pixelDensity(int density) { if (density != this.pixelDensity) { if (insideSettings("pixelDensity", density)) { + if (density != 1 && density != 2) { + throw new RuntimeException("pixelDensity() can only be 1 or 2"); + } this.pixelDensity = density; } }