fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] libvob/vob/buoy buoymanager.py


From: Matti Katila
Subject: [ff-cvs] libvob/vob/buoy buoymanager.py
Date: Tue, 19 Aug 2003 12:01:33 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Matti Katila <address@hidden>   03/08/19 12:01:32

Modified files:
        vob/buoy       : buoymanager.py 

Log message:
        Closes fatal bug: "menu and clicks do not go to the viewport that is in 
front" - not very sharply coded but works

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/buoy/buoymanager.py.diff?tr1=1.60&tr2=1.61&r1=text&r2=text

Patches:
Index: libvob/vob/buoy/buoymanager.py
diff -u libvob/vob/buoy/buoymanager.py:1.60 libvob/vob/buoy/buoymanager.py:1.61
--- libvob/vob/buoy/buoymanager.py:1.60 Sun Aug 17 07:35:00 2003
+++ libvob/vob/buoy/buoymanager.py      Tue Aug 19 12:01:32 2003
@@ -299,15 +299,34 @@
                vob.AbstractUpdateManager.chg()
                return 1
 
+        hits = []
+        for i in self.singles: hits.append(jarray.zeros(1, 'f'))
+
        # Fall through if no link - need main node
+        # See if anyone hit.
        for i in range(0, len(self.singles)):
-           if self.singles[i].mainNode.hasMouseHit(self.vs, ev.getX(), 
ev.getY(), None):
-                self.lastIndex = i
-               if self.singles[i].mainNode.mouse(ev, self.vs):
-                   self.replaceScene = self.vs
-                   vob.AbstractUpdateManager.setNoAnimation()
-               vob.AbstractUpdateManager.chg()
-               return 1
+            if not self.singles[i].mainNode. \
+                   hasMouseHit(self.vs, ev.getX(), ev.getY(), hits[i]):
+                hits[i] = None
+
+
+        # See if something is upper than another.
+        theMostUpMainNode = None
+        mostUpDepth = -9999999999.9
+        for i in range(len(hits)):
+            if hits[i]:
+                if mostUpDepth < hits[i][0]:
+                    self.lastIndex = i
+                    mostUpDepth = hits[i][0]
+                    theMostUpMainNode = self.singles[i].mainNode
+        
+        # If the most upper main node is available use it.
+        if theMostUpMainNode:
+            if theMostUpMainNode.mouse(ev, self.vs):
+                self.replaceScene = self.vs
+                vob.AbstractUpdateManager.setNoAnimation()
+            vob.AbstractUpdateManager.chg()
+            return 1
         return 0
 
 vob.impl.gl.GLScreen.dbg = 0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]