From e5de90b67efe8e8ca518159b3a73295d751764c1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 16 Sep 2023 15:38:21 +0200 Subject: 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 --- src/graphui/classes/com/jogamp/graph/ui/layout/Alignment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/layout/Alignment.java') diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/Alignment.java b/src/graphui/classes/com/jogamp/graph/ui/layout/Alignment.java index d8c6f8605..36671d32a 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/layout/Alignment.java +++ b/src/graphui/classes/com/jogamp/graph/ui/layout/Alignment.java @@ -55,14 +55,14 @@ public final class Alignment { /** Top alignment. */ Top ( ( 1 << 3 ) ), + /** Scale object to parent size, e.g. fill {@link GridLayout} or {@link BoxLayout} cell size. */ + Fill ( ( 1 << 4 ) ), + /** Horizontal center alignment. */ - CenterHoriz ( ( 1 << 4 ) ), + CenterHoriz ( ( 1 << 5 ) ), /** Vertical center alignment. */ - CenterVert ( ( 1 << 5 ) ), - - /** Scale object to parent size, e.g. fill {@link GridLayout} or {@link BoxLayout} cell size. */ - Fill ( ( 1 << 15 ) ); + CenterVert ( ( 1 << 6 ) ); Bit(final int v) { value = v; } public final int value; -- cgit v1.2.3