Fixed up the goddamned repaint fuckola. Fucking pain in the ass, all this
Swing, AWT and frame manager interaction. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2325 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: FrameManager.java,v 1.33 2003/03/25 19:06:54 mdb Exp $
|
||||
// $Id: FrameManager.java,v 1.34 2003/03/25 23:05:58 mdb Exp $
|
||||
|
||||
package com.threerings.media;
|
||||
|
||||
@@ -141,7 +141,9 @@ public class FrameManager
|
||||
public FrameManager (JFrame frame, MediaTimer timer)
|
||||
{
|
||||
_frame = frame;
|
||||
_frame.setIgnoreRepaint(true);
|
||||
if (frame instanceof ManagedJFrame) {
|
||||
((ManagedJFrame)_frame).init(this);
|
||||
}
|
||||
_timer = timer;
|
||||
|
||||
// set up our custom repaint manager
|
||||
@@ -457,6 +459,21 @@ public class FrameManager
|
||||
} while (_backimg.contentsLost());
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the {@link ManagedJFrame} when our window was hidden and
|
||||
* reexposed.
|
||||
*/
|
||||
protected void restoreFromBack (Rectangle dirty)
|
||||
{
|
||||
if (_fgfx == null) {
|
||||
_fgfx = _frame.getGraphics();
|
||||
}
|
||||
Log.info("Restoring from back buffer " + StringUtil.toString(dirty) + ".");
|
||||
_fgfx.setClip(dirty);
|
||||
_fgfx.drawImage(_backimg, 0, 0, null);
|
||||
_fgfx.setClip(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* If frame rate display is enabled, builds beginning of performance
|
||||
* status display.
|
||||
@@ -594,7 +611,7 @@ public class FrameManager
|
||||
_fgfx = null;
|
||||
}
|
||||
|
||||
// Log.info("Created back buffer.");
|
||||
// Log.info("Created back buffer [" + width + "x" + height + "].");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user