From 98d6d2f0864e29cf38b0648c6340cd12f95c4106 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 28 Apr 2003 21:02:54 +0000 Subject: [PATCH] Broke out influential bounds computation into a method that can be overridden. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2495 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../miso/client/MisoScenePanel.java | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index c5bc7f7a6..4c7032f63 100644 --- a/src/java/com/threerings/miso/client/MisoScenePanel.java +++ b/src/java/com/threerings/miso/client/MisoScenePanel.java @@ -1,5 +1,5 @@ // -// $Id: MisoScenePanel.java,v 1.19 2003/04/28 20:28:45 mdb Exp $ +// $Id: MisoScenePanel.java,v 1.20 2003/04/28 21:02:54 mdb Exp $ package com.threerings.miso.client; @@ -593,13 +593,7 @@ public class MisoScenePanel extends VirtualMediaPanel protected void rethink () { // recompute our "area of influence" - int infborx = _vbounds.width/3; - int infbory = _vbounds.height/3; - _ibounds.setBounds(_vbounds.x-infborx, _vbounds.y-infbory, - _vbounds.width+2*infborx, - // we go extra on the height because objects - // below can influence fairly high up - _vbounds.height+3*infbory); + computeInfluentialBounds(); // Log.info("Rethinking vb:" + StringUtil.toString(_vbounds) + // " ul:" + StringUtil.toString(_ulpos) + @@ -650,6 +644,28 @@ public class MisoScenePanel extends VirtualMediaPanel recomputeVisible(); } + /** + * Called during the {@link #rethink} process, configures {@link + * #_ibounds} to contain the bounds of the potentially "influential" + * world. Everything that intersects the influential area will be + * resolved on the expectation that it could be scrolled into view at + * any time. The influential bounds should be large enough that the + * time between a block becoming influential and the time at which it + * is resolved is longer than the expected time by which it will be + * scrolled into view, otherwise the users will see the man behind the + * curtain. + */ + protected void computeInfluentialBounds () + { + int infborx = _vbounds.width/3; + int infbory = _vbounds.height/3; + _ibounds.setBounds(_vbounds.x-infborx, _vbounds.y-infbory, + _vbounds.width+2*infborx, + // we go extra on the height because objects + // below can influence fairly high up + _vbounds.height+3*infbory); + } + /** * Called by a scene block when it has completed its resolution * process.