From 831539b09d928677c4dfefab7011d27a6affd1b9 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 28 Apr 2003 18:08:57 +0000 Subject: [PATCH] How simple! If our bounds change, delay a repaint until we have all of our blocks resolved. In the future, we could attempt to resolve the blocks that are needed to repaint the visible view first and allow repaint as soon as those blocks are resolved. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2486 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../miso/client/MisoScenePanel.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index b017ba0aa..6b119f702 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.16 2003/04/26 02:16:18 mdb Exp $ +// $Id: MisoScenePanel.java,v 1.17 2003/04/28 18:08:57 mdb Exp $ package com.threerings.miso.client; @@ -13,6 +13,7 @@ import java.awt.EventQueue; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; +import java.awt.Graphics; import java.awt.Point; import java.awt.Polygon; import java.awt.Rectangle; @@ -529,6 +530,10 @@ 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(); } @@ -655,6 +660,7 @@ public class MisoScenePanel extends VirtualMediaPanel // recompute our visible object set if (--_pendingBlocks == 0) { recomputeVisible(); + _delayRepaint = false; _remgr.invalidateRegion(_vbounds); } @@ -893,6 +899,15 @@ public class MisoScenePanel extends VirtualMediaPanel } } + // documentation inherited + public void paint (Graphics g) + { + if (_delayRepaint) { + return; + } + super.paint(g); + } + // documentation inherited protected void paintInFront (Graphics2D gfx, Rectangle dirty) { @@ -1326,6 +1341,8 @@ public class MisoScenePanel extends VirtualMediaPanel /** A count of blocks in the process of being resolved. */ protected int _pendingBlocks; + protected boolean _delayRepaint = false; + /** A list of the potentially visible objects in the scene. */ protected ArrayList _vizobjs = new ArrayList();