Index: /OpenSceneGraph/trunk/src/osgViewer/StatsHandler.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgViewer/StatsHandler.cpp (revision 9575)
+++ /OpenSceneGraph/trunk/src/osgViewer/StatsHandler.cpp (revision 9601)
@@ -276,5 +276,5 @@
     _camera->setRenderOrder(osg::Camera::POST_RENDER, 10);
 
-    _camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
+    _camera->setProjectionMatrix(osg::Matrix::ortho2D(0,window->getTraits()->width,0,window->getTraits()->height));
     _camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
     _camera->setViewMatrix(osg::Matrix::identity());
@@ -609,6 +609,6 @@
     {
         _pos -= osg::Vec3(0, height, 0.1);
-        this->setMatrix(osg::Matrix::translate(_pos));
-        this->addChild(_statsGraphGeode.get());
+        setMatrix(osg::Matrix::translate(_pos));
+        addChild(_statsGraphGeode.get());
     }
 
@@ -630,14 +630,14 @@
               const osg::Vec4& color, float max, const std::string& nameBegin, const std::string& nameEnd = "")
         {
-            this->setUseDisplayList(false);
-
-            this->setVertexArray(new osg::Vec3Array);
+            setUseDisplayList(false);
+
+            setVertexArray(new osg::Vec3Array);
 
             osg::Vec4Array* colors = new osg::Vec4Array;
             colors->push_back(color);
-            this->setColorArray(colors);
-            this->setColorBinding(osg::Geometry::BIND_OVERALL);
-
-            this->setDrawCallback(new GraphUpdateCallback(width, height, viewerStats, stats, max, nameBegin, nameEnd));
+            setColorArray(colors);
+            setColorBinding(osg::Geometry::BIND_OVERALL);
+
+            setDrawCallback(new GraphUpdateCallback(width, height, viewerStats, stats, max, nameBegin, nameEnd));
         }
     };
@@ -1094,8 +1094,9 @@
         float topOfViewerStats = pos.y() + characterSize;
 
-        geode->addDrawable(createBackgroundRectangle(    pos + osg::Vec3(-backgroundMargin, characterSize + backgroundMargin, 0),
-                                                        _camera->getViewport()->width() - 2 * backgroundMargin,
-                                                        (3 + 4.5 * cameras.size()) * characterSize + 2 * backgroundMargin,
-                                                      backgroundColor) );
+        geode->addDrawable(createBackgroundRectangle(
+            pos + osg::Vec3(-backgroundMargin, characterSize + backgroundMargin, 0),
+            _camera->getViewport()->width() - 2 * backgroundMargin,
+            (3 + 4.5 * cameras.size()) * characterSize + 2 * backgroundMargin,
+            backgroundColor) );
 
         {
