From b421ffb2eceba36037add192e786ef75a152aa99 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 10 Apr 2023 06:09:00 +0200 Subject: GraphUI Scene.pickShape(): Consider isInteractive() most early in visitor() before gluUnProjectRay(..) --- src/graphui/classes/com/jogamp/graph/ui/Scene.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui') diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java index d4c981e62..7d4e10574 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java @@ -490,7 +490,7 @@ public final class Scene implements Container, GLEventListener { shape[0] = null; forSortedAll(Shape.ZAscendingComparator, pmv, (final Shape s, final PMVMatrix pmv2) -> { - final boolean ok = pmv.gluUnProjectRay(glWinX, glWinY, winZ0, winZ1, viewport, ray); + final boolean ok = s.isInteractive() && pmv.gluUnProjectRay(glWinX, glWinY, winZ0, winZ1, viewport, ray); if( ok ) { final AABBox sbox = s.getBounds(); if( sbox.intersectsRay(ray) ) { @@ -899,9 +899,7 @@ public final class Scene implements Container, GLEventListener { final Shape[] shape = { null }; if( null == pickShape(pmv, glWinX, glWinY, objPos, shape, () -> { setActiveShape(shape[0]); - if( shape[0].isInteractive() ) { - shape[0].dispatchMouseEvent(e, glWinX, glWinY, objPos); - } + shape[0].dispatchMouseEvent(e, glWinX, glWinY, objPos); } ) ) { releaseActiveShape(); -- cgit v1.2.3