summaryrefslogtreecommitdiff
path: root/grc/gui/canvas/flowgraph.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/canvas/flowgraph.py')
-rw-r--r--grc/gui/canvas/flowgraph.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/grc/gui/canvas/flowgraph.py b/grc/gui/canvas/flowgraph.py
index 648b6c3d08..598f81b067 100644
--- a/grc/gui/canvas/flowgraph.py
+++ b/grc/gui/canvas/flowgraph.py
@@ -282,7 +282,12 @@ class FlowGraph(CoreFlowgraph, Drawable):
pasted_blocks[block_name] = block # that is before any rename
block.move((x_off, y_off))
- #TODO: prevent block from being pasted directly on top of another block
+ while any(Utils.align_to_grid(block.coordinate) == Utils.align_to_grid(other.coordinate)
+ for other in self.blocks if other is not block):
+ block.move((Constants.CANVAS_GRID_SIZE, Constants.CANVAS_GRID_SIZE))
+ # shift all following blocks
+ x_off += Constants.CANVAS_GRID_SIZE
+ y_off += Constants.CANVAS_GRID_SIZE
self.selected_elements = set(pasted_blocks.values())