From d6319c128dc37c0e6046fa5453abb54430770b43 Mon Sep 17 00:00:00 2001 From: Dave Hoover Date: Thu, 29 May 2008 00:09:51 +0000 Subject: [PATCH] If we pass in a panel, we really DO want to use it. And don't NPE if we resolve a block and don't have a panel (though my NPE was really because of the first problem) git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@514 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/java/com/threerings/miso/client/SceneBlock.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/miso/client/SceneBlock.java b/src/java/com/threerings/miso/client/SceneBlock.java index c8c34265..d7d2ed8e 100644 --- a/src/java/com/threerings/miso/client/SceneBlock.java +++ b/src/java/com/threerings/miso/client/SceneBlock.java @@ -61,6 +61,7 @@ public class SceneBlock { this(panel.getSceneModel(), panel.getSceneMetrics(), panel.getTileManager(), tx, ty, width, height); + _panel = panel; } public SceneBlock (MisoSceneModel model, MisoSceneMetrics metrics, TileManager tileMgr, @@ -213,7 +214,9 @@ public class SceneBlock */ protected void wasResolved () { - _panel.blockResolved(this); + if (_panel != null) { + _panel.blockResolved(this); + } } /** @@ -233,9 +236,8 @@ public class SceneBlock } /** - * Returns the bounds of the screen coordinate rectangle that contains - * all pixels that are drawn on by all tiles and objects in this - * block. + * Returns the bounds of the screen coordinate rectangle that contains all pixels that are + * drawn on by all tiles and objects in this block. */ public Rectangle getScreenBounds () {