From 4d7993b59fd71ca518d5232b8310ba089621e1f5 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 28 Apr 2003 21:10:19 +0000 Subject: [PATCH] Only delay repaint on setBounds() if we end up queueing up blocks as a result. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2496 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../miso/client/MisoScenePanel.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index 4c7032f63..b3d7def57 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.20 2003/04/28 21:02:54 mdb Exp $ +// $Id: MisoScenePanel.java,v 1.21 2003/04/28 21:10:19 mdb Exp $ package com.threerings.miso.client; @@ -530,12 +530,12 @@ public class MisoScenePanel extends VirtualMediaPanel setViewLocation(_nx+dx, _ny+dy); _rsize.setSize(width, height); - // make a note that we should not repaint until we get all of - // our blocks - _delayRepaint = true; - // ...and force a rethink - rethink(); + if (rethink() > 0) { + // make a note that we should not repaint until we get all + // of our blocks + _delayRepaint = true; + } } } @@ -589,8 +589,10 @@ public class MisoScenePanel extends VirtualMediaPanel *
  • Flush any blocks that are no longer influential. *
  • Recompute the list of potentially visible scene objects. * + * + * @return the count of blocks pending after this rethink. */ - protected void rethink () + protected int rethink () { // recompute our "area of influence" computeInfluentialBounds(); @@ -601,7 +603,7 @@ public class MisoScenePanel extends VirtualMediaPanel // not to worry if we presently have no scene model if (_model == null) { - return; + return 0; } // compute the intersecting set of blocks @@ -642,6 +644,8 @@ public class MisoScenePanel extends VirtualMediaPanel // recompute our visible object set recomputeVisible(); + + return _pendingBlocks; } /**