Skip to content

Commit d63a843

Browse files
committed
BlockCanvas: Only can drop properties of the BlockCode's parent node
Godot allows drag any thing. However, if it is a property, block code script only manipulates the properties of BlockCode node's parent node. So, when drag a property, only allow drop the parent node's property. Fixes: 89beea9 ("BlockCanvas: Implement drag & drop the node's property from Inspector") https://phabricator.endlessm.com/T35649
1 parent 1423220 commit d63a843

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/block_code/ui/block_canvas/block_canvas.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool:
8181
if typeof(data) != TYPE_DICTIONARY:
8282
return false
8383

84-
# Allow dropping property block
84+
# Allow dropping property block of the block code node's parent node
8585
if data.get("type", "") == "obj_property":
86+
if data["object"] != _context.parent_node:
87+
return false
8688
return true
8789

8890
var nodes: Array = data.get("nodes", [])

0 commit comments

Comments
 (0)