Explorar el Código

patch around e3hack for stansalone

Asad M. Zaman hace 19 años
padre
commit
bc1570ce98
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 2 2
      direct/src/gui/DirectGuiBase.py
  2. 1 0
      direct/src/gui/DirectScrolledList.py

+ 2 - 2
direct/src/gui/DirectGuiBase.py

@@ -715,7 +715,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
         if self['guiId']:
             self.guiItem.setId(self['guiId'])
         self.guiId = self.guiItem.getId()
-        if __dev__ or base.cr.wantE3hacks:
+        if __dev__ or (hasattr(base, 'cr') and base.cr.wantE3hacks):
             # track gui items by guiId for tracking down leaks
             if hasattr(base, 'guiItems'):
                 if self.guiId in base.guiItems:
@@ -1008,7 +1008,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
         self.updateFrameStyle()
 
     def destroy(self):
-        if __dev__ or base.cr.wantE3hacks:
+        if __dev__ or (hasattr(base, 'cr') and base.cr.wantE3hacks):
             if hasattr(base, 'guiItems'):
                 if self.guiId in base.guiItems:
                     del base.guiItems[self.guiId]

+ 1 - 0
direct/src/gui/DirectScrolledList.py

@@ -242,6 +242,7 @@ class DirectScrolledList(DirectFrame):
 
             item.show()
             item.setPos(0, 0,  -(i-self.index) * self.maxHeight)
+            #print 'height bug tracker: i-%s idx-%s h-%s' % (i, self.index, self.maxHeight)
 
         if self['command']:
             # Pass any extra args to command