In the fix for the macintosh copy area bug, it's pointless to compute the
rectangle of the area that would have been copied, as we know that the _entire_ visible area is now dirty due to the failed copy. Replace the list of dirty rectangles with one rectangle encompassing everything, it will cut down on the iterations in the paint() method and should improve performance on the JVM that exhibits the copyArea bug. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3307 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -390,16 +390,8 @@ public class VirtualMediaPanel extends MediaPanel
|
||||
height - Math.abs(_dy), -_dx, -_dy);
|
||||
} catch (Exception e) {
|
||||
// HACK when it throws an exception trying to do the
|
||||
// copy area, just tag the are we were trying to copy
|
||||
// to onto the end of the dirty rects array.
|
||||
int length = dirty.length;
|
||||
Rectangle[] ndirty = new Rectangle[length + 1];
|
||||
System.arraycopy(dirty, 0, ndirty, 0, length);
|
||||
ndirty[length] =new Rectangle(_vbounds.x + cx-_dx,
|
||||
_vbounds.y + cy-_dy,
|
||||
width - Math.abs(_dx),
|
||||
height - Math.abs(_dy));
|
||||
dirty = ndirty;
|
||||
// copy area, just repaint everything
|
||||
dirty = new Rectangle[] { new Rectangle(_vbounds) };
|
||||
}
|
||||
} else {
|
||||
gfx.copyArea(cx, cy,
|
||||
|
||||
Reference in New Issue
Block a user