Gui: add SoColorBarLabel as workaround for a Coin3D bug
This commit is contained in:
@@ -298,6 +298,33 @@ void SoTextLabel::GLRender(SoGLRenderAction *action)
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
||||
SO_NODE_SOURCE(SoColorBarLabel)
|
||||
|
||||
void SoColorBarLabel::initClass()
|
||||
{
|
||||
SO_NODE_INIT_CLASS(SoColorBarLabel, SoText2, "Text2");
|
||||
}
|
||||
|
||||
SoColorBarLabel::SoColorBarLabel()
|
||||
{
|
||||
SO_NODE_CONSTRUCTOR(SoColorBarLabel);
|
||||
}
|
||||
|
||||
void SoColorBarLabel::computeBBox(SoAction * action, SbBox3f & box, SbVec3f & center)
|
||||
{
|
||||
inherited::computeBBox(action, box, center);
|
||||
if (!box.hasVolume()) {
|
||||
SbViewVolume vv = SoViewVolumeElement::get(action->getState());
|
||||
// workaround for https://github.com/coin3d/coin/issues/417:
|
||||
// extend by 2 percent
|
||||
vv.scaleWidth(1.02f);
|
||||
SoViewVolumeElement::set(action->getState(), this, vv);
|
||||
inherited::computeBBox(action, box, center);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
||||
SO_NODE_SOURCE(SoStringLabel)
|
||||
|
||||
void SoStringLabel::initClass()
|
||||
|
||||
Reference in New Issue
Block a user