feat(Storybok): Inspection tool - better selection of parent item to draw auxiliary lines

This commit is contained in:
Michał Cieślak 2023-06-20 11:38:43 +02:00 committed by Michał
parent 40adfa2d90
commit 2663d4a4c2
1 changed files with 5 additions and 2 deletions

View File

@ -62,13 +62,16 @@ Item {
const isRoot = parentIndex === -1
const parent = isRoot ? root : placeholders[parentIndex]
const visualParent = isRoot ? root : (parent.isVisual ? parent : parent.visualParent)
const visualParent = isRoot ? root
: (parent.isVisual
? (parent.background || parent)
: parent.visualParent)
const x = isRoot ? 0 : item.x
const y = isRoot ? 0 : item.y
const name = InspectionUtils.simpleName(item)
const visual = InspectionUtils.isVisual(item)
const visual = InspectionUtils.isVisual(item) || !!item.background
const clip = item.clip
const props = {