Core properly sets nil parent

This commit is contained in:
Sasha Koshka 2023-03-15 01:46:58 -04:00
parent 1a66224648
commit 2f60abdfa3
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ func (core *Core) MinimumSize () (width, height int) {
// overridden, unless you want to detect when the element is parented or
// unparented.
func (core *Core) SetParent (parent elements.Parent) {
if core.parent != nil {
if parent != nil && core.parent != nil {
panic("core.SetParent: element already has a parent")
}