From c26ce87830e35591bec0c247249d22b6772cc88d Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Thu, 15 Jul 2010 20:44:12 +0000 Subject: [PATCH] When we move the scene, we need to wait a tick for the blocks to get in place before we move ourselves. Otherwise we get exciting blank regions. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@956 ed5b42cb-e716-0410-a449-f6a68f950b19 --- .../threerings/miso/client/MisoScenePanel.as | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/as/com/threerings/miso/client/MisoScenePanel.as b/src/as/com/threerings/miso/client/MisoScenePanel.as index a381a7bf..c637d5f5 100644 --- a/src/as/com/threerings/miso/client/MisoScenePanel.as +++ b/src/as/com/threerings/miso/client/MisoScenePanel.as @@ -257,20 +257,22 @@ public class MisoScenePanel extends Sprite _objScene.render(); - // Then we let the scene finally move if it's trying to... - if (_pendingMoveBy != null) { - _isoView.centerOnPt(new Pt(_pendingMoveBy.x + _isoView.currentX, - _pendingMoveBy.y + _isoView.currentY), false); - _pendingMoveBy = null; - } - - // Now, take out any old blocks no longer in our valid blocks. - var blocks :Set = getBaseBlocks(); - for each (var baseKey :int in _blocks.keys()) { - if (!blocks.contains(baseKey)) { - _blocks.remove(baseKey).release(); + DelayUtil.delayFrame(function() :void { + // Then we let the scene finally move if it's trying to... + if (_pendingMoveBy != null) { + _isoView.centerOnPt(new Pt(_pendingMoveBy.x + _isoView.currentX, + _pendingMoveBy.y + _isoView.currentY), false); + _pendingMoveBy = null; } - } + + // Now, take out any old blocks no longer in our valid blocks. + var blocks :Set = getBaseBlocks(); + for each (var baseKey :int in _blocks.keys()) { + if (!blocks.contains(baseKey)) { + _blocks.remove(baseKey).release(); + } + } + }); } protected function refreshScene () :void