summaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-13 05:41:01 +0200
committerSven Gothel <[email protected]>2023-04-13 05:41:01 +0200
commitaca5b9b176f3c3393d8c7666a252488d44b18f2e (patch)
tree0909ccbbc1cce47c39e29a5f49553db2b43ef0e4 /src/graphui/classes/com/jogamp/graph
parentc1ad62f886d135932280270933f14fe4433b84a9 (diff)
GraphUI GridLayout: Also adjust potential bottom-left delta when centering shape to cell (like GlyphShape w/ underline)
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java5
1 files changed, 3 insertions, 2 deletions
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 7d1739dd6..d5ba8e289 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
@@ -128,11 +128,12 @@ public class GridLayout implements Group.Layout {
final float sxy = sx < sy ? sx : sy;
final float dxh = sbox.getWidth() * ( sx - sxy ) * 0.5f;
final float dyh = sbox.getHeight() * ( sy - sxy ) * 0.5f;
- s.moveTo( x + dxh, y + dyh, 0f );
+ s.moveTo( x + dxh, y + dyh, 0f ); // center the scaled artifact
+ s.move( sbox.getLow().mul(-1f*sxy) ); // remove the bottom-left delta
s.scale( sxy, sxy, 1f);
box.resize( x + cellWidth + padding.right, y + cellHeight + padding.top, 0);
box.resize( x - padding.left, y - padding.bottom, 0);
- // System.err.println("["+row_i+"]["+col_i+"]: "+x+" / "+y);
+ // System.err.println("["+row_i+"]["+col_i+"]: "+x+" / "+y+", sxy "+sxy+", d[xy]h "+dxh+" x "+dyh+", "+sbox);
// position for next cell
if( Order.COLUMN == order ) {