Implemented clipping of widget to the widgets extents.

This commit is contained in:
Robert Osfield
2014-05-23 18:59:16 +00:00
parent cca18e82e8
commit f50ec0fe8e
7 changed files with 78 additions and 49 deletions

View File

@@ -71,8 +71,6 @@ void PushButton::leaveImplementation()
void PushButton::createGraphicsImplementation()
{
OSG_NOTICE<<"PushButton::createGraphicsImplementation()"<<std::endl;
osg::ref_ptr<osg::Group> group = new osg::Group;
Style* style = (getStyle()!=0) ? getStyle() : Style::instance().get();
@@ -97,6 +95,8 @@ void PushButton::createGraphicsImplementation()
group->addChild(_textDrawable.get());
style->setupClipStateSet(_extents, getOrCreateStateSet());
setGraphicsSubgraph(group.get());
}