From ba6d7e0f7a55274ddfc7617c7a723ff89821c65e Mon Sep 17 00:00:00 2001 From: Paul Liverman Date: Fri, 1 Apr 2016 15:48:58 -0700 Subject: [PATCH] working on extensions/optional parenting --- demo/main.lua | 1 + src/pop/init.moon | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/main.lua b/demo/main.lua index e6b3992..04df5c5 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -23,6 +23,7 @@ function love.load() --]] --c:move(100) + pop.box({255, 0, 0, 255}):position(50, 600) -- testing streamlined_get_set extension & optional parents --[[ w2 = pop.window(nil, "Window") diff --git a/src/pop/init.moon b/src/pop/init.moon index b012eb8..ba3c848 100644 --- a/src/pop/init.moon +++ b/src/pop/init.moon @@ -79,11 +79,10 @@ instanceOfElement = (object) -> pop.create = (element, parent=pop.screen, ...) -> if instanceOfElement parent element = pop.elements[element](parent, ...) + insert parent.child, element else element = pop.elements[element](pop.screen, parent, ...) - - if parent - insert parent.child, element + insert pop.screen.child, element return element