From 58ba592b289a22136f77c66b6cfe16f20413de04 Mon Sep 17 00:00:00 2001 From: phil Date: Wed, 2 Nov 2016 13:39:32 +1300 Subject: Transparency value must be clamped [0.0, 1.0] Otherwise you can easily get crash to desktop error in the pipeline. --- src/main/java/org/jogamp/java3d/TransparencyAttributesRetained.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/jogamp/java3d/TransparencyAttributesRetained.java b/src/main/java/org/jogamp/java3d/TransparencyAttributesRetained.java index ddade7a..f56a941 100644 --- a/src/main/java/org/jogamp/java3d/TransparencyAttributesRetained.java +++ b/src/main/java/org/jogamp/java3d/TransparencyAttributesRetained.java @@ -92,6 +92,7 @@ class TransparencyAttributesRetained extends NodeComponentRetained { * fully opaque and 1.0 being fully transparent */ final void initTransparency(float transparency) { + transparency = Math.max(0, Math.min(1, transparency)); this.transparency = transparency; } @@ -103,6 +104,7 @@ class TransparencyAttributesRetained extends NodeComponentRetained { * fully opaque and 1.0 being fully transparent */ final void setTransparency(float transparency) { + transparency = Math.max(0, Math.min(1, transparency)); initTransparency(transparency); sendMessage(VALUE_CHANGED, new Float(transparency)); } -- cgit v1.2.3