aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-09-16 14:03:25 +0200
committerSven Gothel <[email protected]>2023-09-16 14:03:25 +0200
commit1e55d2a6a157cb9d70f7a879cc9a9bc97db5413d (patch)
tree355c2a274e8cfba28d5b160878534b373ce3ecb8 /src/graphui/classes/com
parentd1cfa99135154e8e651e86ebc48a0f635fad38aa (diff)
GraphUI Group.validateImpl(): Pick RenderMode for border from 1st Shape if required (hasBorder() and null border yet)
This avoid changing the RenderMode and hence actual shader rendering the item.
Diffstat (limited to 'src/graphui/classes/com')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/Group.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java
index 95a829b3e..6ddfa9700 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/Group.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java
@@ -253,10 +253,16 @@ public class Group extends Shape implements Container {
@Override
protected void validateImpl(final GLProfile glp, final GL2ES2 gl) {
if( isShapeDirty() ) {
+ final boolean needsRMs = hasBorder() && null == border;
+ GraphShape firstGS = null;
+
// box has been reset
final PMVMatrix pmv = new PMVMatrix();
if( null != layouter ) {
for(final Shape s : shapes) {
+ if( needsRMs && null == firstGS && s instanceof GraphShape ) {
+ firstGS = (GraphShape)s;
+ }
layouter.preValidate(s);
if( null != gl ) {
s.validate(gl);
@@ -268,6 +274,9 @@ public class Group extends Shape implements Container {
} else {
final AABBox tsbox = new AABBox();
for(final Shape s : shapes) {
+ if( needsRMs && null == firstGS && s instanceof GraphShape ) {
+ firstGS = (GraphShape)s;
+ }
if( null != gl ) {
s.validate(gl);
} else {
@@ -290,7 +299,9 @@ public class Group extends Shape implements Container {
}
if( hasBorder() ) {
if( null == border ) {
- border = new Rectangle(Region.VBAA_RENDERING_BIT, box, getBorderThickness());
+ final int firstRMs = null != firstGS ? firstGS.getRenderModes() : 0;
+ final int myRMs = Region.isVBAA(firstRMs) ? Region.VBAA_RENDERING_BIT : 0;
+ border = new Rectangle(myRMs, box, getBorderThickness());
} else {
border.setEnabled(true);
border.setBounds(box, getBorderThickness());