From 306ab40451f79dc6e41113efd597bddbd79514a5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 26 Sep 2023 04:14:05 +0200 Subject: GraphUI Layout: Simplify non-centered negative-offset (underline) removal --- .../classes/com/jogamp/graph/ui/layout/BoxLayout.java | 13 ++----------- .../classes/com/jogamp/graph/ui/layout/GridLayout.java | 13 ++----------- 2 files changed, 4 insertions(+), 22 deletions(-) (limited to 'src/graphui/classes/com/jogamp') 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); } -- cgit v1.2.3