diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index ce2a25f56..517527102 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -7287,14 +7287,15 @@ public class PGraphics extends PImage implements PConstants { * Strangely the old version of this code ignored the alpha * value. not sure if that was a bug or what. *
- * Note, no need for a bounds check since it's a 32 bit number. + * Note, no need for a bounds check for 'argb' since it's a 32 bit number. + * Bounds now checked on alpha, however (rev 0225). */ protected void colorCalcARGB(int argb, float alpha) { if (alpha == colorModeA) { calcAi = (argb >> 24) & 0xff; calcColor = argb; } else { - calcAi = (int) (((argb >> 24) & 0xff) * (alpha / colorModeA)); + calcAi = (int) (((argb >> 24) & 0xff) * PApplet.constrain((alpha / colorModeA), 0, 1)); calcColor = (calcAi << 24) | (argb & 0xFFFFFF); } calcRi = (argb >> 16) & 0xff; diff --git a/core/todo.txt b/core/todo.txt index cfa162ed9..69652e51d 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -5,6 +5,10 @@ X call revalidate() via reflection X text looks lousy compared to the Apple JVM X mess with rendering hints? (notes in PGraphicsJava2D) X improvements made, but still not amazing.. just at level of Windows/Linux +o XML.getChildren() throwing NPE when getInt() called on non-existent var +o https://github.com/processing/processing/issues/2367 +X PGraphics.colorCalcARGB(int, float) doesn't cap alpha +X https://github.com/processing/processing/issues/2439 fixed in 2.1 X draw() called again before finishing on OS X (retina issue) @@ -37,14 +41,9 @@ A https://github.com/processing/processing/issues/2416 A fix pixels[] array for video capture A https://github.com/processing/processing/issues/2424 -_ PGraphics.colorCalcARGB(int, float) doesn't cap alpha -_ https://github.com/processing/processing/issues/2439 - _ tint() not working in PDF (regression from previous release) _ https://github.com/processing/processing/issues/2428 -_ XML.getChildren() fix -_ https://github.com/processing/processing/issues/2367 _ default font fixes _ https://github.com/processing/processing/issues/2331 _ https://github.com/processing/processing/pull/2338