From 8a9fce09d86c1700ecd8f7cb0cda8fd515d78d9b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 30 Oct 2002 10:07:16 +0000 Subject: [PATCH] Fixed addChild(node,value) so that it resizes using the _newChildDefaultValue rather than the add child value, then sets the child's value to value. --- src/osg/Switch.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osg/Switch.cpp b/src/osg/Switch.cpp index 21e970b1b..4c4621870 100644 --- a/src/osg/Switch.cpp +++ b/src/osg/Switch.cpp @@ -45,10 +45,15 @@ bool Switch::addChild( Node *child ) bool Switch::addChild( Node *child, bool value ) { + unsigned int childPosition = _children.size(); if (Group::addChild(child)) { - if (_children.size()>_values.size()) _values.resize(_children.size(),value); - return true; + if (_children.size()>_values.size()) + { + _values.resize(_children.size(),_newChildDefaultValue); + _values[childPosition]=value; + } + return true; } return false; }