account for child 3d/multiple in bounding box
This commit is contained in:
parent
8cce0aa54c
commit
5d7b0af127
1 changed files with 3 additions and 2 deletions
|
|
@ -1340,11 +1340,12 @@ func fitPadding(obj *d2graph.Object) {
|
|||
|
||||
for _, child := range obj.ChildrenArray {
|
||||
margin, _ := getSpacing(child)
|
||||
dx, dy := child.GetModifierElementAdjustments()
|
||||
|
||||
innerTop = math.Min(innerTop, child.TopLeft.Y-math.Max(margin.top, padding.top))
|
||||
innerTop = math.Min(innerTop, child.TopLeft.Y-dy-math.Max(margin.top, padding.top))
|
||||
innerBottom = math.Max(innerBottom, child.TopLeft.Y+child.Height+math.Max(margin.bottom, padding.bottom))
|
||||
innerLeft = math.Min(innerLeft, child.TopLeft.X-math.Max(margin.left, padding.left))
|
||||
innerRight = math.Max(innerRight, child.TopLeft.X+child.Width+math.Max(margin.right, padding.right))
|
||||
innerRight = math.Max(innerRight, child.TopLeft.X+child.Width+dx+math.Max(margin.right, padding.right))
|
||||
}
|
||||
|
||||
currentTop := obj.TopLeft.Y
|
||||
|
|
|
|||
Loading…
Reference in a new issue