Some fixes but components are still not getting properly repainted in all cases

for some reason.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@117 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2007-01-20 03:58:18 +00:00
parent fb91fd8770
commit 283fd15f19
@@ -129,12 +129,14 @@ public class MediaOverlay
*/
public void propagateDirtyRegions (ActiveRepaintManager repmgr, JRootPane root)
{
// this will clear out our region manager, so we need to keep these around for our
// subsequent call to paint
_dirty = _metamgr.getRegionManager().getDirtyRegions();
for (int ii = 0; ii < _dirty.length; ii++) {
Rectangle dirty = _dirty[ii];
repmgr.addDirtyRegion(root, dirty.x, dirty.y, dirty.width, dirty.height);
if (_metamgr.needsPaint()) {
// this will clear out our dirty regions, so we need to keep these around for our
// subsequent call to paint
_dirty = _metamgr.getRegionManager().getDirtyRegions();
for (int ii = 0; ii < _dirty.length; ii++) {
Rectangle dirty = _dirty[ii];
repmgr.addDirtyRegion(root, dirty.x, dirty.y, dirty.width, dirty.height);
}
}
}
@@ -146,12 +148,13 @@ public class MediaOverlay
*/
public boolean paint (Graphics2D gfx)
{
if (_metamgr.needsPaint()) {
if (_dirty != null) {
for (int ii = 0; ii < _dirty.length; ii++) {
gfx.setClip(_dirty[ii]);
_metamgr.paintMedia(gfx, MediaConstants.BACK, _dirty[ii]);
_metamgr.paintMedia(gfx, MediaConstants.FRONT, _dirty[ii]);
}
_dirty = null;
return true;
}
return false;