aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-16 01:04:10 +0100
committerSven Göthel <[email protected]>2024-01-16 01:04:10 +0100
commit33ec9480da3d414a4c973607970afa06b5ed79ca (patch)
treefb9a7211a28ec8829493c31102b7a85e0e2ffc2d /src/graphui/classes/com/jogamp/graph/ui
parentf06fe57b0ae738870a61700ff2c65680102d9e73 (diff)
GraphUI RangedGroup.validateImpl(): Simplify updating contentPosZero
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java
index 0f1a9d43a..8f68a99fc 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java
@@ -149,19 +149,23 @@ public class RangedGroup extends Widget {
@Override
protected void validateImpl(final GL2ES2 gl, final GLProfile glp) {
if( isShapeDirty() ) {
- // enforcing layout for content to be moved for repositioning
super.validateImpl(gl, glp);
+ final AABBox b = content.getBounds();
+ final Vec2f contentSize = getContentSize();
+ contentPosZero.set(0, 0);
if( null != horizSlider ) {
horizSlider.setMinMax(new Vec2f(0, content.getBounds().getWidth()), 0);
+ if( horizSlider.isInverted() ) {
+ contentPosZero.setX( contentSize.x() - b.getWidth() );
+ }
}
if( null != vertSlider ) {
vertSlider.setMinMax(new Vec2f(0, content.getBounds().getHeight()), 0);
+ if( vertSlider.isInverted() ) {
+ contentPosZero.setY( contentSize.y() - b.getHeight() );
+ }
}
- final AABBox b = content.getBounds();
- final Vec2f contentSize = getContentSize();
- contentPosZero.setX( null != horizSlider && horizSlider.isInverted() ? contentSize.x() - b.getWidth() : 0 );
- contentPosZero.setY( null != vertSlider && vertSlider.isInverted() ? contentSize.y() - b.getHeight() : 0 );
}
}
@Override