diff options
author | Sven Gothel <[email protected]> | 2023-09-24 02:35:41 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-09-24 02:35:41 +0200 |
commit | 1281e1ace2fbc884dd3ad4b561054a19f8e498c5 (patch) | |
tree | cdcec70d28d40019f6caea000915d988d65036d9 /src/demos | |
parent | 13a81396bd5183d1f2c00c517936c54efaa61db3 (diff) |
UISceneDemo20: Set proper z-epsilon for all Buttons on reshape to use the perfect minimum label-z-offset
Diffstat (limited to 'src/demos')
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java index 837d5770d..b9e455ec3 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java @@ -1046,12 +1046,16 @@ public class UISceneDemo20 implements GLEventListener { scene.reshape(drawable, x, y, width, height); final AABBox sceneBox = scene.getBounds(); + final float zEpsilon = scene.getZEpsilon(16); System.err.println("Reshape: Scene Plane.1 "+sceneBox); + System.err.println("Reshape: Scene zEpsilon "+zEpsilon); final float sceneWidth = sceneBox.getWidth(); final float sceneHeight = sceneBox.getHeight(); final float button_sxy = sceneWidth > sceneHeight ? sceneWidth : sceneHeight; + buttonsLeft.forAll((final Shape s) -> { if( s instanceof Button) { ((Button)s).setLabelZOffset(zEpsilon); } return false; } ); + buttonsRight.forAll((final Shape s) -> { if( s instanceof Button) { ((Button)s).setLabelZOffset(zEpsilon); } return false; } ); buttonsLeft.validate(drawable.getGL().getGL2ES2()); buttonsRight.validate(drawable.getGL().getGL2ES2()); |