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) 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()) {
// subsequent call to paint // this will clear out our dirty regions, so we need to keep these around for our
_dirty = _metamgr.getRegionManager().getDirtyRegions(); // subsequent call to paint
for (int ii = 0; ii < _dirty.length; ii++) { _dirty = _metamgr.getRegionManager().getDirtyRegions();
Rectangle dirty = _dirty[ii]; for (int ii = 0; ii < _dirty.length; ii++) {
repmgr.addDirtyRegion(root, dirty.x, dirty.y, dirty.width, dirty.height); 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) 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;