summaryrefslogtreecommitdiffstats
path: root/src/graphui/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-29 03:22:51 +0200
committerSven Gothel <[email protected]>2023-04-29 03:22:51 +0200
commit34a6853f8bef69277863dba181195a9275b55b16 (patch)
treef43aefdba9c82ea53b77985cd24f34b136a5ffba /src/graphui/classes
parent45298f3d4ef14cf3cc8eafb568f8b891c0aa4b41 (diff)
GraphUI GridLayout: Handle 'diffBL' in 2nd path, no need to store as we don't use PMVMatrix for computation
Diffstat (limited to 'src/graphui/classes')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java20
1 files changed, 10 insertions, 10 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 6990ac75d..d4a976012 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
@@ -139,7 +139,6 @@ public class GridLayout implements Group.Layout {
float x=0, y=0;
float totalWidth=-Float.MAX_VALUE, totalHeight=-Float.MAX_VALUE;
final AABBox[] sboxes = new AABBox[shapes.size()];
- final Vec3f[] diffBLs = new Vec3f[shapes.size()];
final float[] y_pos = new float[col_count * row_count]; // y_bottom = totalHeight - y_pos[..]
// Pass-1: Determine totalHeight, while collect sbox and y_pos
@@ -151,14 +150,6 @@ public class GridLayout implements Group.Layout {
{
final AABBox sbox0 = s.getBounds();
sboxes[i] = sbox0.transformMv(pmv, new AABBox());
-
- final Vec3f diffBL = new Vec3f();
- if( !diffBL.set( sbox0.getLow().x(), sbox0.getLow().y(), 0).min( zeroVec3 ).isZero() ) {
- // pmv.mulMvMatVec3f(diffBL).scale(-1f, -1f, 0f);
- final Vec3f ss = s.getScale();
- diffBL.scale(-1f*ss.x(), -1f*ss.y(), 0f);
- }
- diffBLs[i] = diffBL;
}
pmv.glPopMatrix();
final AABBox sbox = sboxes[i];
@@ -226,8 +217,17 @@ public class GridLayout implements Group.Layout {
for(int i=0; i < shapes.size(); ++i) {
final Shape s = shapes.get(i);
final AABBox sbox = sboxes[i];
- final Vec3f diffBL = diffBLs[i];
final float zPos = sbox.getCenter().z();
+ final Vec3f diffBL = new Vec3f();
+
+ {
+ final AABBox sbox0 = s.getBounds();
+ if( !diffBL.set( sbox0.getLow().x(), sbox0.getLow().y(), 0).min( zeroVec3 ).isZero() ) {
+ // pmv.mulMvMatVec3f(diffBL).scale(-1f, -1f, 0f);
+ final Vec3f ss = s.getScale();
+ diffBL.scale(-1f*ss.x(), -1f*ss.y(), 0f);
+ }
+ }
if( TRACE_LAYOUT ) {
System.err.println("gl("+i+")["+col_i+"]["+row_i+"].0: "+s);