From ae04712b2bec43f85b9bccefa2894dec5b1aa07c Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Tue, 1 Jul 2008 04:39:27 +0000 Subject: [PATCH] Toggle visibility when delaying repainting to keep child components from painting while we aren't git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@557 ed5b42cb-e716-0410-a449-f6a68f950b19 --- .../threerings/miso/client/MisoScenePanel.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index 1b384740..45c77cf1 100644 --- a/src/java/com/threerings/miso/client/MisoScenePanel.java +++ b/src/java/com/threerings/miso/client/MisoScenePanel.java @@ -741,11 +741,13 @@ public class MisoScenePanel extends VirtualMediaPanel _ulpos.setLocation(_tcoords); if (rethink() > 0) { _delayRepaint = mightDelayPaint; - log.info("Got new pending blocks " + - "[need=" + _visiBlocks.size() + - ", of=" + _pendingBlocks + - ", view=" + StringUtil.toString(_vbounds) + - ", delay=" + _delayRepaint + "]."); + // If this is a complete repaint, turn off visibility while we're resolving to + // keep child components or media panels from drawing. + if (_delayRepaint) { + setVisible(false); + } + log.info("Got new pending blocks", "need", _visiBlocks.size(), "of", + _pendingBlocks, "view", StringUtil.toString(_vbounds), "delay", _delayRepaint); } } } @@ -956,9 +958,11 @@ public class MisoScenePanel extends VirtualMediaPanel // resolution, recompute our visible object set and show ourselves if (_visiBlocks.remove(block) && _visiBlocks.size() == 0) { recomputeVisible(); - log.info("Restoring repaint... [left=" + _pendingBlocks + - ", view=" + StringUtil.toString(_vbounds) + "]."); + log.info("Restoring repaint... ", "left", _pendingBlocks, "view", + StringUtil.toString(_vbounds)); _delayRepaint = false; + // Need to restore visibility as it may have been turned of as a result of the delay + setVisible(true); _remgr.invalidateRegion(_vbounds); } }