diff options
author | Sven Gothel <[email protected]> | 2023-09-16 15:38:21 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-09-16 15:38:21 +0200 |
commit | e5de90b67efe8e8ca518159b3a73295d751764c1 (patch) | |
tree | 49b751489dda73b510e4db37abed6b8824ec0372 /src/demos/com/jogamp | |
parent | 1e55d2a6a157cb9d70f7a879cc9a9bc97db5413d (diff) |
GraphUI BoxLayout: Margin is only ignored for center Alignment w/o Fill scale. {Box,Grid}Layout: Always remove Bottom-Left delta and refine API doc of incl scale behavior
GraphUI BoxLayout: Margin is only ignored for center Alignment w/o Fill scale.
Margin outside of a shape is not scaled and hence must be considered
when using Fill scale.
{Box,Grid}Layout: Always remove Bottom-Left delta
Previously we were only dropping the negative extend.
However, since our scale and center algo uses the AABBox width and height,
which excludes the bottom-left delta, we have to drop such offset.
TODO: Otherwise, we would need adjust for the bottom-left extend
when NOT centering for each direction!
This might be a useful enhancement in case one likes to drop
shapes as-is w/o centering.
{Box,Grid}Layout: Refine API doc of incl scale behavior
Diffstat (limited to 'src/demos/com/jogamp')
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java index 70db5d696..cef57d503 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java @@ -346,7 +346,15 @@ public class UILayoutBox01 { groups.add(g); } ++id; + nextPos.setX( nextPos.x() + sxy * cellGap ); + + if( true ) { + final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.FillCenter, margin, null ) ), + reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener); + groups.add(g); + } nextPos.set(0, nextPos.y() + sxy * cellGap, 0); + ++id; // // 3. Row @@ -385,7 +393,7 @@ public class UILayoutBox01 { ++id; if( true ) { - final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Fill, new Margin(), padding ) ), + final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Fill, margin, padding ) ), reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener); groups.add(g); } @@ -393,7 +401,7 @@ public class UILayoutBox01 { ++id; if( true ) { - final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.Fill, margin, padding ) ), + final Group g = fillDemoGroup(new Group( new BoxLayout( 1f, 1f, Alignment.FillCenter, margin, padding ) ), reqGLP, scene, zEps, sxy, nextPos, font, id, dragZoomRotateListener); groups.add(g); } |