Catch and report any exceptions thrown by Component.paint() to allow

peacable continued frame painting in cases where a component gets in a bad
way and fails to paint itself happily.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1432 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2002-06-10 21:31:56 +00:00
parent 43f7fc44c1
commit 7a9946e0ad
@@ -1,5 +1,5 @@
//
// $Id: FrameRepaintManager.java,v 1.7 2002/05/04 05:13:54 mdb Exp $
// $Id: FrameRepaintManager.java,v 1.8 2002/06/10 21:31:56 shaper Exp $
package com.threerings.media;
@@ -345,7 +345,16 @@ public class FrameRepaintManager extends RepaintManager
g.setClip(drect);
g.translate(_cbounds.x, _cbounds.y);
ocomp.paint(g);
try {
// some components are ill-behaved and may throw an
// exception while painting themselves, and so we
// needs must deal with these fellows gracefully
ocomp.paint(g);
} catch (Exception e) {
Log.warning("Exception while painting component " +
"[comp=" + ocomp + ", e=" + e + "].");
Log.logStackTrace(e);
}
g.translate(-_cbounds.x, -_cbounds.y);
} else if (root != null) {