forked from rojo-rbx/rojo
Select Instances from diff tree (#709)
This commit is contained in:
@@ -131,6 +131,7 @@ local function Tree()
|
||||
id = ancestorId,
|
||||
className = value.ClassName,
|
||||
name = value.Name,
|
||||
instance = if typeof(value) == "Instance" then value else nil,
|
||||
})
|
||||
previousId = ancestorId
|
||||
end
|
||||
@@ -236,6 +237,7 @@ function PatchVisualizer:buildTree(patch, instanceMap)
|
||||
patchType = "Edit",
|
||||
className = instance.ClassName,
|
||||
name = instance.Name,
|
||||
instance = instance,
|
||||
hint = hint,
|
||||
changeList = changeList,
|
||||
})
|
||||
@@ -271,10 +273,11 @@ function PatchVisualizer:buildTree(patch, instanceMap)
|
||||
patchType = "Remove",
|
||||
className = instance.ClassName,
|
||||
name = instance.Name,
|
||||
instance = instance,
|
||||
})
|
||||
end
|
||||
|
||||
for _, change in patch.added do
|
||||
for id, change in patch.added do
|
||||
-- Gather ancestors from existing DOM or future additions
|
||||
local ancestry = {}
|
||||
local parentId = change.Parent
|
||||
@@ -344,6 +347,7 @@ function PatchVisualizer:buildTree(patch, instanceMap)
|
||||
name = change.Name,
|
||||
hint = hint,
|
||||
changeList = changeList,
|
||||
instance = instanceMap.fromIds[id],
|
||||
})
|
||||
end
|
||||
|
||||
@@ -370,6 +374,7 @@ function PatchVisualizer:render()
|
||||
setElementHeight = setElementHeight,
|
||||
patchType = node.patchType,
|
||||
className = node.className,
|
||||
instance = node.instance,
|
||||
name = node.name,
|
||||
hint = node.hint,
|
||||
changeList = node.changeList,
|
||||
|
||||
Reference in New Issue
Block a user