Fix ContainerBox child insertion
This commit is contained in:
parent
0e2ad5bb4f
commit
6a2dc36140
@ -119,10 +119,14 @@ func (this *containerBox) Insert (child, before tomo.Object) {
|
||||
|
||||
beforeBox := assertAnyBox(before.GetBox())
|
||||
index := indexOf(this.children, tomo.Box(beforeBox))
|
||||
if index < 0 { return }
|
||||
|
||||
|
||||
if index < 0 {
|
||||
this.children = append(this.children, tomo.Box(box))
|
||||
} else {
|
||||
this.children = insert(this.children, index, tomo.Box(box))
|
||||
}
|
||||
box.setParent(this)
|
||||
this.children = insert(this.children, index, tomo.Box(box))
|
||||
|
||||
this.invalidateLayout()
|
||||
this.invalidateMinimum()
|
||||
}
|
||||
|
Reference in New Issue
Block a user