diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/jogamp/java3d/TransparencyAttributesRetained.java | 2 |
1 files changed, 2 insertions, 0 deletions
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)); } |