changeset 1460:871aea815e7a

RT-23395 Canvas Exception J2D
author "Joseph Andresen<joseph.andresen@oracle.com>"
date Mon, 16 Jul 2012 11:32:48 -0700
parents 2ca0c5dc56ee
children 49d71d1bc5af
files javafx-ui-common/src/javafx/scene/canvas/GraphicsContext.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/javafx/scene/canvas/GraphicsContext.java	Fri Jul 13 10:25:02 2012 +0200
+++ b/javafx-ui-common/src/javafx/scene/canvas/GraphicsContext.java	Mon Jul 16 11:32:48 2012 -0700
@@ -568,9 +568,11 @@
 
     /**
      * Sets the Global Alpha of the current state.
-     * @param alpha 
+     * @param alpha value in the range {@code 0.0-1.0}. The value is clamped if it is 
+     * out of range.
      */
     public void setGlobalAlpha(double alpha) {
+        alpha = (alpha > 1.0) ? 1.0 : (alpha < 0.0) ? 0.0 : alpha;
         if (curState.globalAlpha != alpha) {
             curState.globalAlpha = alpha;
             writeParam(alpha, PGCanvas.GLOBAL_ALPHA);