Copy-paste no longer clears previous selection.
This commit is contained in:
parent
66747461b5
commit
daf729eedb
@ -60,11 +60,12 @@ currentViewSetting = sessionSettings.getOption("currentview", unicode, "cam")
|
|||||||
# chunks into its viewports.
|
# chunks into its viewports.
|
||||||
|
|
||||||
class PendingImport(object):
|
class PendingImport(object):
|
||||||
def __init__(self, sourceDim, pos, selection, text):
|
def __init__(self, sourceDim, pos, selection, text, isMove=False):
|
||||||
self.selection = selection
|
self.selection = selection
|
||||||
self.text = text
|
self.text = text
|
||||||
self.pos = pos
|
self.pos = pos
|
||||||
self.sourceDim = sourceDim
|
self.sourceDim = sourceDim
|
||||||
|
self.isMove = isMove
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "%s(%r, %r, %r)" % (self.__class__.__name__, self.sourceDim, self.selection, self.pos)
|
return "%s(%r, %r, %r)" % (self.__class__.__name__, self.sourceDim, self.selection, self.pos)
|
||||||
|
@ -341,7 +341,8 @@ class MoveTool(EditorTool):
|
|||||||
# blocks will be moved.
|
# blocks will be moved.
|
||||||
pos = self.editorSession.currentSelection.origin
|
pos = self.editorSession.currentSelection.origin
|
||||||
pendingImport = PendingImport(self.editorSession.currentDimension, pos,
|
pendingImport = PendingImport(self.editorSession.currentDimension, pos,
|
||||||
self.editorSession.currentSelection, self.tr("<Moved Object>"))
|
self.editorSession.currentSelection, self.tr("<Moved Object>"),
|
||||||
|
isMove=True)
|
||||||
moveCommand = MoveSelectionCommand(self, pendingImport)
|
moveCommand = MoveSelectionCommand(self, pendingImport)
|
||||||
|
|
||||||
self.editorSession.pushCommand(moveCommand)
|
self.editorSession.pushCommand(moveCommand)
|
||||||
@ -360,13 +361,18 @@ class MoveTool(EditorTool):
|
|||||||
|
|
||||||
with command.begin():
|
with command.begin():
|
||||||
# TODO don't use intermediate schematic...
|
# TODO don't use intermediate schematic...
|
||||||
export = self.currentImport.sourceDim.exportSchematicIter(self.currentImport.selection)
|
if self.currentImport.isMove:
|
||||||
schematic = showProgress("Copying...", export)
|
export = self.currentImport.sourceDim.exportSchematicIter(self.currentImport.selection)
|
||||||
|
schematic = showProgress("Copying...", export)
|
||||||
|
dim = schematic.getDimension()
|
||||||
|
fill = self.editorSession.currentDimension.fillBlocksIter(self.currentImport.selection, "air")
|
||||||
|
showProgress("Clearing...", fill)
|
||||||
|
else:
|
||||||
|
dim = self.currentImport.sourceDim
|
||||||
|
|
||||||
fill = self.editorSession.currentDimension.fillBlocksIter(self.editorSession.currentSelection, "air")
|
task = self.editorSession.currentDimension.copyBlocksIter(dim, dim.bounds,
|
||||||
showProgress("Clearing...", fill)
|
self.currentImport.pos,
|
||||||
|
biomes=True, create=True)
|
||||||
task = self.editorSession.currentDimension.importSchematicIter(schematic, self.currentImport.pos)
|
|
||||||
showProgress(self.tr("Pasting..."), task)
|
showProgress(self.tr("Pasting..."), task)
|
||||||
|
|
||||||
self.editorSession.pushCommand(command)
|
self.editorSession.pushCommand(command)
|
||||||
|
Reference in New Issue
Block a user