From a6621626aa934207b4475ff4066387b42fbdef7b Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 22 Feb 2016 15:22:37 +0100 Subject: [PATCH] Don't use multiple parent node paths in CSVRender::Object --- apps/opencs/view/render/object.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index 33939625d4..c220321d59 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -160,7 +160,6 @@ CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode, mBaseNode->addCullCallback(new SceneUtil::LightListCallback); mOutline = new osgFX::Scribe; - mOutline->addChild(mBaseNode); mBaseNode->setUserData(new ObjectTag(this)); @@ -194,10 +193,14 @@ void CSVRender::Object::setSelected(bool selected) { mSelected = selected; + mOutline->removeChild(mBaseNode); mParentNode->removeChild(mOutline); mParentNode->removeChild(mBaseNode); if (selected) + { + mOutline->addChild(mBaseNode); mParentNode->addChild(mOutline); + } else mParentNode->addChild(mBaseNode); }