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,7 +129,8 @@ public class MediaOverlay
*/ */
public void propagateDirtyRegions (ActiveRepaintManager repmgr, JRootPane root) public void propagateDirtyRegions (ActiveRepaintManager repmgr, JRootPane root)
{ {
// this will clear out our region manager, so we need to keep these around for our if (_metamgr.needsPaint()) {
// this will clear out our dirty regions, so we need to keep these around for our
// subsequent call to paint // subsequent call to paint
_dirty = _metamgr.getRegionManager().getDirtyRegions(); _dirty = _metamgr.getRegionManager().getDirtyRegions();
for (int ii = 0; ii < _dirty.length; ii++) { for (int ii = 0; ii < _dirty.length; ii++) {
@@ -137,6 +138,7 @@ public class MediaOverlay
repmgr.addDirtyRegion(root, dirty.x, dirty.y, dirty.width, dirty.height); repmgr.addDirtyRegion(root, dirty.x, dirty.y, dirty.width, dirty.height);
} }
} }
}
/** /**
* Called by the {@link FrameManager} after everything is done painting, allowing us to paint * Called by the {@link FrameManager} after everything is done painting, allowing us to paint
@@ -146,12 +148,13 @@ public class MediaOverlay
*/ */
public boolean paint (Graphics2D gfx) public boolean paint (Graphics2D gfx)
{ {
if (_metamgr.needsPaint()) { if (_dirty != null) {
for (int ii = 0; ii < _dirty.length; ii++) { for (int ii = 0; ii < _dirty.length; ii++) {
gfx.setClip(_dirty[ii]); gfx.setClip(_dirty[ii]);
_metamgr.paintMedia(gfx, MediaConstants.BACK, _dirty[ii]); _metamgr.paintMedia(gfx, MediaConstants.BACK, _dirty[ii]);
_metamgr.paintMedia(gfx, MediaConstants.FRONT, _dirty[ii]); _metamgr.paintMedia(gfx, MediaConstants.FRONT, _dirty[ii]);
} }
_dirty = null;
return true; return true;
} }
return false; return false;