diff options
author | Sven Gothel <[email protected]> | 2023-09-26 04:14:05 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-09-26 04:14:05 +0200 |
commit | 306ab40451f79dc6e41113efd597bddbd79514a5 (patch) | |
tree | ce7a4c4b376db9c9d79a157bc9dd691f7f642306 /src/graphui/classes/com | |
parent | 1beed5ba82b55a292bb1f916d615f152139a7060 (diff) |
GraphUI Layout: Simplify non-centered negative-offset (underline) removal
Diffstat (limited to 'src/graphui/classes/com')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java | 13 | ||||
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java | 13 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java index 3bfa2b27f..80d9d0d50 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java @@ -261,19 +261,10 @@ public class BoxLayout implements Group.Layout { diffBL.setX(0); // only adjust negative if !center-horiz } diffBL.scale(s.getScale()).scale(-1f); - s.move( diffBL.scale(sxy) ); - } else if( diffBL.x() < 0 || diffBL.y() < 0 ) { - if( diffBL.x() > 0 ) { - diffBL.setX(0); - } - if( diffBL.y() > 0 ) { - diffBL.setY(0); - } - diffBL.scale(s.getScale()).scale(-1f); - s.move( diffBL.scale(sxy) ); } else { - diffBL.set(0, 0, 0); + diffBL.min(new Vec3f()).scale(s.getScale()).scale(-1f); } + s.move( diffBL.scale(sxy) ); if( TRACE_LAYOUT ) { System.err.println("bl("+i+").bl: sbox0 "+s.getBounds()+", diffBL_ "+diffBL); } diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java index 9a90160d5..8175a8daf 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java @@ -335,19 +335,10 @@ public class GridLayout implements Group.Layout { diffBL.setX(0); // only adjust negative if !center-horiz } diffBL.scale(s.getScale()).scale(-1f); - s.move( diffBL.scale(sxy) ); - } else if( diffBL.x() < 0 || diffBL.y() < 0 ) { - if( diffBL.x() > 0 ) { - diffBL.setX(0); - } - if( diffBL.y() > 0 ) { - diffBL.setY(0); - } - diffBL.scale(s.getScale()).scale(-1f); - s.move( diffBL.scale(sxy) ); } else { - diffBL.set(0, 0, 0); + diffBL.min(new Vec3f()).scale(s.getScale()).scale(-1f); } + s.move( diffBL.scale(sxy) ); if( TRACE_LAYOUT ) { System.err.println("gl("+i+")["+col_i+"]["+row_i+"].bl: sbox0 "+s.getBounds()+", diffBL_ "+diffBL); } |