Only do the Windows copyArea() workaround on Windows because it crashes

the MacOS JVM (though the MacOS JVM has the same fricking bug, it's just
that the workaround doesn't "work").


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2534 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-05-02 23:49:57 +00:00
parent daa9c8ee0e
commit df50d9fb0d
@@ -1,5 +1,5 @@
//
// $Id: VirtualMediaPanel.java,v 1.17 2003/05/02 15:11:51 mdb Exp $
// $Id: VirtualMediaPanel.java,v 1.18 2003/05/02 23:49:57 mdb Exp $
package com.threerings.media;
@@ -13,6 +13,7 @@ import java.awt.event.MouseEvent;
import javax.swing.SwingUtilities;
import com.samskivert.util.RunAnywhere;
import com.samskivert.util.StringUtil;
import com.threerings.media.util.Path;
@@ -313,11 +314,17 @@ public class VirtualMediaPanel extends MediaPanel
// graphics context results in boochness; so we have to
// untranslate the graphics context, do our copyArea() and
// then translate it back
gfx.translate(-_abounds.x, -_abounds.y);
gfx.copyArea(_abounds.x + cx, _abounds.y + cy,
width - Math.abs(_dx),
height - Math.abs(_dy), -_dx, -_dy);
gfx.translate(_abounds.x, _abounds.y);
if (RunAnywhere.isWindows()) {
gfx.translate(-_abounds.x, -_abounds.y);
gfx.copyArea(_abounds.x + cx, _abounds.y + cy,
width - Math.abs(_dx),
height - Math.abs(_dy), -_dx, -_dy);
gfx.translate(_abounds.x, _abounds.y);
} else {
gfx.copyArea(cx, cy,
width - Math.abs(_dx),
height - Math.abs(_dy), -_dx, -_dy);
}
// and clear out our scroll deltas
_dx = 0; _dy = 0;