From aca5b9b176f3c3393d8c7666a252488d44b18f2e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 13 Apr 2023 05:41:01 +0200 Subject: GraphUI GridLayout: Also adjust potential bottom-left delta when centering shape to cell (like GlyphShape w/ underline) --- src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph') 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 ) { -- cgit v1.2.3