diff options
author | Sven Gothel <[email protected]> | 2023-03-14 15:01:56 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-14 15:01:56 +0100 |
commit | e41f65f34afade96ba211bae0ce9dc8146435c00 (patch) | |
tree | b3644696312059a461492fbfe7bb6d48b4f8f2f3 /src/graphui | |
parent | 9c471fe3efe7413b76eeb70b480de9e9c8f19b86 (diff) |
GraphUI: Button: Allow user to configure 2-pass label z-offset
Diffstat (limited to 'src/graphui')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Button.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Button.java b/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Button.java index 981441f9a..ff406991b 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Button.java +++ b/src/graphui/classes/com/jogamp/graph/ui/gl/shapes/Button.java @@ -57,6 +57,7 @@ public class Button extends RoundButton { public static final float DEFAULT_SPACING_Y = 0.42f; private static final float DEFAULT_2PASS_LABEL_ZOFFSET = -0.005f; // -0.05f; + private float twoPassLabelZOffset = DEFAULT_2PASS_LABEL_ZOFFSET; private final Label0 label; private float spacingX = DEFAULT_SPACING_X; @@ -93,9 +94,9 @@ public class Button extends RoundButton { protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) { final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory()); if(corner == 0.0f) { - createSharpOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET); + createSharpOutline(shape, twoPassLabelZOffset); } else { - createCurvedOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET); + createCurvedOutline(shape, twoPassLabelZOffset); } shape.setIsQuadraticNurbs(); shape.setSharpness(shapesSharpness); @@ -139,6 +140,13 @@ public class Button extends RoundButton { } } + public float get2PassLabelZOffset() { return twoPassLabelZOffset; } + + public void set2PassLabelZOffset(final float v) { + twoPassLabelZOffset = v; + markShapeDirty(); + } + public final float getSpacingX() { return spacingX; } public final float getSpacingY() { return spacingY; } |