Changed the Switch::addChild(Node*) behavior so it doesn't override the
any pre-exisitng _values value.
This commit is contained in:
parent
21c8924d83
commit
64e6b79340
@ -47,7 +47,17 @@ void Switch::traverse(NodeVisitor& nv)
|
||||
|
||||
bool Switch::addChild( Node *child )
|
||||
{
|
||||
return addChild(child,_newChildDefaultValue);
|
||||
if (Group::addChild(child))
|
||||
{
|
||||
if (_children.size()>_values.size())
|
||||
{
|
||||
_values.resize(_children.size(),_newChildDefaultValue);
|
||||
}
|
||||
// note, we don't override any pre-existing _values[childPosition] setting
|
||||
// like in addChild(child,value) below.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Switch::addChild( Node *child, bool value )
|
||||
|
Loading…
Reference in New Issue
Block a user