Fix the viewport of the character preview being set a frame ahead due to a threading issue

0.6.1
scrawl 8 years ago
parent 20606a2aff
commit 7f634514a8

@ -254,7 +254,10 @@ namespace MWRender
sizeX = std::max(sizeX, 0);
sizeY = std::max(sizeY, 0);
mCamera->setViewport(0, mSizeY-sizeY, std::min(mSizeX, sizeX), std::min(mSizeY, sizeY));
// NB Camera::setViewport has threading issues
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
stateset->setAttributeAndModes(new osg::Viewport(0, mSizeY-sizeY, std::min(mSizeX, sizeX), std::min(mSizeY, sizeY)));
mCamera->setStateSet(stateset);
redraw();
}

Loading…
Cancel
Save