diff --git a/addons/block_code/drag_manager/drag_manager.gd b/addons/block_code/drag_manager/drag_manager.gd index 97c71a4f..41f3b0e0 100644 --- a/addons/block_code/drag_manager/drag_manager.gd +++ b/addons/block_code/drag_manager/drag_manager.gd @@ -42,7 +42,6 @@ class Drag: assert(block.get_parent() == null) add_child(block) - block.on_canvas = false block.position = -offset _block = block @@ -92,7 +91,7 @@ class Drag: push_error("Warning: snap point %s does not reference its parent block." % _snap_point) return false - if not _snap_point.block.on_canvas: + if not _block_canvas.is_ancestor_of(_snap_point): # We only snap to blocks on the canvas: return false diff --git a/addons/block_code/ui/block_canvas/block_canvas.gd b/addons/block_code/ui/block_canvas/block_canvas.gd index 4ea0f278..b3e0857d 100644 --- a/addons/block_code/ui/block_canvas/block_canvas.gd +++ b/addons/block_code/ui/block_canvas/block_canvas.gd @@ -32,7 +32,6 @@ func _populate_block_scenes_by_class(): func add_block(block: Block, position: Vector2 = Vector2.ZERO) -> void: block.position = position block.position.y += _window_scroll.scroll_vertical - block.on_canvas = true _window.add_child(block) _window.custom_minimum_size.y = max(block.position.y + EXTEND_MARGIN, _window.custom_minimum_size.y) @@ -83,7 +82,6 @@ func load_tree(parent: Node, node: SerializedBlockTreeNode): for prop_pair in node.serialized_block.serialized_props: scene.set(prop_pair[0], prop_pair[1]) - scene.on_canvas = true parent.add_child(scene) var scene_block: Block = scene as Block diff --git a/addons/block_code/ui/blocks/block/block.gd b/addons/block_code/ui/blocks/block/block.gd index 79ec85b4..51e021b9 100644 --- a/addons/block_code/ui/blocks/block/block.gd +++ b/addons/block_code/ui/blocks/block/block.gd @@ -23,8 +23,6 @@ signal modified ## The next block in the line of execution (can be null if end) @export var bottom_snap_path: NodePath -var on_canvas: bool = false - var bottom_snap: SnapPoint diff --git a/addons/block_code/ui/blocks/utilities/snap_point/snap_point.gd b/addons/block_code/ui/blocks/utilities/snap_point/snap_point.gd index 21d31223..2c7fb2b6 100644 --- a/addons/block_code/ui/blocks/utilities/snap_point/snap_point.gd +++ b/addons/block_code/ui/blocks/utilities/snap_point/snap_point.gd @@ -35,7 +35,6 @@ func set_snapped_block(snapped_block: Block) -> Block: if snapped_block: add_child(snapped_block) - snapped_block.on_canvas = block.on_canvas if snapped_block and orphaned_block: var last_snap = _get_last_snap(snapped_block)