1.0: DirectScrolledFrame makes other GUI items vanish

I’m using a home-compiled installation of the development version of Panda, as taken from the repository (updated a little over an hour before time of writing, I believe), and I’ve encountered an issue: simply put, it seems that DirectScrolledFrames, when holding and displaying a DirectButton, cause other GUI elements to disappear–which

I don’t think that I’ve experimented with controls other than DirectButton in the frame, so it may well be more general than this report indicates.

It looks almost as though the DirectScrolledFrames have their occlusion inverted: showing overlapping items, but hiding those outside of themselves.

The following code is a small test-case that displays the error on my end. Press either of the two buttons to toggle two respective DirectScrolledFrames, one containing a button and one without; you should see that the frame controlled by the left-hand button contains a button and produces the bug, while the frame controlled by the right-hand button is empty and does not produce the bug.

from panda3d.core import Vec4, PandaNode, NodePath
from direct.showbase.DirectObject import DirectObject
import direct.directbase.DirectStart

from direct.gui.DirectGui import *

class GameFramework(DirectObject):
    def __init__(self):
        base.disableMouse()
        
        quitBtn = DirectButton(text = "Quit", command = base.userExit,
                                scale = 0.07, parent = aspect2d)
        quitBtn.setPos(render2d, 0, 0, -0.9)
        
        self.testGuiRoot1 = aspect2d.attachNewNode(PandaNode("mew"))
        self.testGuiRoot1.hide()
        
        self.testGuiRoot2 = aspect2d.attachNewNode(PandaNode("mew"))
        self.testGuiRoot2.hide()
        
        btn = DirectButton(text = "TOGGLE", pos = (-0.5, 0, -0.5), scale = 0.05, command = self.toggle1)
        btn = DirectButton(text = "TOGGLE", pos = (0.5, 0, -0.5), scale = 0.05, command = self.toggle2)
        
        self.list1 = DirectScrolledFrame(relief = DGG.FLAT,
                                        canvasSize = (0, 0.01, 0, 0.9),
                                        parent = self.testGuiRoot1)
        btn = DirectButton(text = "Test",
                           parent = self.list1.getCanvas(),
                           pos = (0.5, 0, 0.5),
                           scale = 0.05)
        
        self.list2 = DirectScrolledFrame(relief = DGG.FLAT,
                                        canvasSize = (0, 0.01, 0, 0.9),
                                        parent = self.testGuiRoot2)
    
    def toggle1(self):
        if self.testGuiRoot1.isHidden():
            self.testGuiRoot1.show()
        else:
            self.testGuiRoot1.hide()
    
    def toggle2(self):
        if self.testGuiRoot2.isHidden():
            self.testGuiRoot2.show()
        else:
            self.testGuiRoot2.hide()

gameFramework = GameFramework()
run()

A screenshot–note the partially-visible buttons near the bottom of the frame, which appear to be visible inside the frame but occluded outside of it, despite not being children of it.

It looks like the DirectScrolledFrame is doing the right thing when it comes to scissoring the children, except that the scissoring is accidentally also being applied to other nodes. This is probably related to the scissor changes I checked in a while ago. I’ll take a look.

OK, the scissor state wasn’t being reset properly after rendering the node with scissor enabled. I just pushed a fix.

Thanks so much for reporting!

Ah, wonderful, and thank you very much! I’ve updated, rebuilt and confirmed that the problem is indeed fixed on my end. :slight_smile:

It’s great to be able to see my entire UI again!