From df50d9fb0d009b03f7dbdac80e22ff3696a7b85e Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 2 May 2003 23:49:57 +0000 Subject: [PATCH] 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 --- .../threerings/media/VirtualMediaPanel.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/media/VirtualMediaPanel.java b/src/java/com/threerings/media/VirtualMediaPanel.java index 72cf8dd64..51e04d093 100644 --- a/src/java/com/threerings/media/VirtualMediaPanel.java +++ b/src/java/com/threerings/media/VirtualMediaPanel.java @@ -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;