diff --git a/include/osgUtil/StateGraph b/include/osgUtil/StateGraph index 454e4cb71..bffa5955c 100644 --- a/include/osgUtil/StateGraph +++ b/include/osgUtil/StateGraph @@ -28,11 +28,11 @@ namespace osgUtil { -struct LeafDepthSortFunctor +struct LessDepthSortFunctor { bool operator() (const osg::ref_ptr& lhs,const osg::ref_ptr& rhs) { - return (lhs->_depth>rhs->_depth); + return (lhs->_depth < rhs->_depth); } }; @@ -140,7 +140,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced inline void sortFrontToBack() { - std::sort(_leaves.begin(),_leaves.end(),LeafDepthSortFunctor()); + std::sort(_leaves.begin(),_leaves.end(),LessDepthSortFunctor()); } /** Reset the internal contents of a StateGraph, including deleting all children.*/