Fix chunk loading origin not updating after changing dimensions

Offscreen views were being added to chunkLoader clients and controlling the load order...
This commit is contained in:
David Vierra 2015-06-03 22:51:55 -10:00
parent 0c897f397c
commit 4a54d0f5a4
3 changed files with 11 additions and 5 deletions

View File

@ -971,8 +971,14 @@ class EditorTab(QtGui.QWidget):
def dimensionDidChange(self, dim):
for view in self.views:
view.setDimension(dim)
# EditorSession has a new loader now, so re-add minimap and current view
self.editorSession.loader.addClient(self.miniMap)
view = self.currentView()
if view is not None:
self.editorSession.loader.addClient(view)
def toolDidChange(self, tool):
if tool.toolWidget:
self.toolOptionsArea.takeWidget() # setWidget gives ownership to the scroll area
@ -1021,7 +1027,10 @@ class EditorTab(QtGui.QWidget):
:rtype: mcedit2.worldview.worldview.WorldView
"""
return self.viewStack.currentWidget().worldView
widget = self.viewStack.currentWidget()
if widget is None:
return None
return widget.worldView
def showViewFrame(self, frame):
center = self.currentView().viewCenter()

View File

@ -194,8 +194,6 @@ class WorldView(QGLWidget):
self.matrixNode = scenegraph.MatrixNode()
self._updateMatrices()
self.matrixNode.addChild(self.loadableChunksNode)
self.matrixNode.addChild(self.worldScene)
self.matrixNode.addChild(self.overlayNode)

View File

@ -423,8 +423,7 @@ class WorldEditor(object):
log.info("Dim %s: Found %d chunks in %0.2f seconds.",
dimName,
len(chunkPositions),
time.time() -
start)
time.time() - start)
self._allChunks[dimName] = chunkPositions
def chunkCount(self, dimName):