Bug? in 1.8: DirectSlider.getBounds and tightbounds returns0

It looks like the DirectSlider and DirectScrollBar getBounds and getTightBounds returns 0, or Point3(0,0,0) respectively.

The getTightBounds() of a DirectGui object will generally return 0, because the DirectGui object doesn’t have any geometry in the conventional sense (its geometry is tucked away in a hidden node within it–you can get to it, but it’s not in the scene graph in the normal place).

However, getBounds() is overloaded in a DirectGui object to return the widget’s 2-d frame, assuming the frame hasn’t been suppressed. So this method should return something non-zero if your object has been properly initialized.

Still, for DirectGui objects it might be better to use widget[‘frameSize’] instead, which will return the explicitly specified frame size in case your frame has no visible geometry.

David

That isn’t the behaviour I am getting:

label = DirectLabel(text=“Throttle”)

label.getTightBounds() returns
(LPoint3f(-1.83333, 0, -0.133333), LPoint3f(1.95, 0, 0.73))
label.getBounds() reutns [-1.833, 1.95, -0.13, 0.73]
label[‘frameSize’] returns None

throttle = DirectSlider(range=(-100, 100), value=0, pageSize=1, orientation=VERTICAL, frameSize=(-0.5, 0.5, -1, 1))

throttle.getBounds() returns [0.0, 0.0, 0.0, 0.0]
throttle[‘frameSize’] returns (-0.5, 0.5, -1, 1)