From 9568a062f187b259e87a1eea8a97a67a5e8ceb20 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Oct 2008 17:09:36 +0000 Subject: [PATCH] From Wojciech Lewandowski, "I am sending a really minor fix for StatsHandler::reset method. We dynamically add and remove slave cameras in our application. StatsHandler does not automatically adapt to this situation, and we call StatsHandler::reset to force it to update number of cameras and their graphs. Unfortunately, if stats were already drawn, reset would not remove former graph drawables and they would remain frozen below new stats. This update fixes it. " --- src/osgViewer/StatsHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osgViewer/StatsHandler.cpp b/src/osgViewer/StatsHandler.cpp index 640d9cca3..65431f0ec 100644 --- a/src/osgViewer/StatsHandler.cpp +++ b/src/osgViewer/StatsHandler.cpp @@ -232,6 +232,7 @@ void StatsHandler::reset() { _initialized = false; _camera->setGraphicsContext(0); + _camera->removeChildren( 0, _camera->getNumChildren() ); } void StatsHandler::setUpHUDCamera(osgViewer::ViewerBase* viewer)