Patch from nvanderh: handle dirtying properly if our bounds change between
frames. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@86 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -98,11 +98,23 @@ public class MultiFrameAnimation extends Animation
|
|||||||
_finished = true;
|
_finished = true;
|
||||||
|
|
||||||
} else if (fidx != _fidx) {
|
} else if (fidx != _fidx) {
|
||||||
|
// make a note of our current bounds
|
||||||
|
Rectangle dirty = new Rectangle(_bounds);
|
||||||
|
|
||||||
// update our frame index and bounds
|
// update our frame index and bounds
|
||||||
setFrameIndex(fidx);
|
setFrameIndex(fidx);
|
||||||
|
|
||||||
// and have ourselves repainted
|
if (_mgr != null) {
|
||||||
invalidate();
|
// if our new bounds intersect our old bounds, grow a single
|
||||||
|
// dirty rectangle to incorporate them both, otherwise
|
||||||
|
// invalidate them separately
|
||||||
|
if (_bounds.intersects(dirty)) {
|
||||||
|
dirty.add(_bounds);
|
||||||
|
} else {
|
||||||
|
_mgr.getRegionManager().invalidateRegion(_bounds);
|
||||||
|
}
|
||||||
|
_mgr.getRegionManager().addDirtyRegion(dirty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user