From a832ea9863f4479085c46eb43f5c79c50b0dc518 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 13 Apr 2023 05:39:57 +0200 Subject: GraphUI Group: Avoid additional shapes-loop w/o layouter --- src/graphui/classes/com/jogamp/graph/ui/Group.java | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/graphui') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java index e349b1302..e831676ed 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Group.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java @@ -207,23 +207,28 @@ public class Group extends Shape implements Container { protected void validateImpl(final GLProfile glp, final GL2ES2 gl) { if( isShapeDirty() ) { final PMVMatrix pmv = new PMVMatrix(); - final AABBox tmpBox = new AABBox(); - for(final Shape s : shapes) { - if( null != gl ) { - s.validate(gl); - } else { - s.validate(glp); - } - } if( null != layouter ) { + for(final Shape s : shapes) { + if( null != gl ) { + s.validate(gl); + } else { + s.validate(glp); + } + } layouter.layout(this, box, pmv); } else { + final AABBox tsbox = new AABBox(); for(final Shape s : shapes) { + if( null != gl ) { + s.validate(gl); + } else { + s.validate(glp); + } pmv.glPushMatrix(); s.setTransform(pmv); - s.getBounds().transformMv(pmv, tmpBox); + s.getBounds().transformMv(pmv, tsbox); pmv.glPopMatrix(); - box.resize(tmpBox); + box.resize(tsbox); } } } -- cgit v1.2.3