Skip to content

Commit f3eb0ac

Browse files
committed
bugfix
Fixed :removeChild()
1 parent 599edf5 commit f3eb0ac

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Basalt/objects/Container.lua

+6-7
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ return function(name, basalt)
3636
end
3737

3838
local function getChild(self, name)
39-
if (type(name)=="table") then
40-
name = name:getName()
41-
end
4239
for _, v in ipairs(children) do
4340
if v.element:getName() == name then
4441
return v.element
@@ -47,7 +44,7 @@ return function(name, basalt)
4744
end
4845

4946
local function getDeepChild(self, name)
50-
local maybeChild = getChild(name)
47+
local maybeChild = self:getChild(name)
5148
if (maybeChild ~= nil) then
5249
return maybeChild
5350
end
@@ -87,19 +84,21 @@ return function(name, basalt)
8784

8885
local function removeChild(self, element)
8986
if (type(element)=="string") then
90-
element = getChild(element:getName())
87+
element = self:getChild(element)
9188
end
9289
if (element==nil) then
9390
return
9491
end
9592
for i, v in ipairs(children) do
9693
if v.element:getName() == element:getName() then
9794
table.remove(children, i)
95+
self:removeEvents(element)
96+
sorted = false
97+
self:updateDraw()
9898
return true
9999
end
100100
end
101-
self:removeEvents(element)
102-
sorted = false
101+
return false
103102
end
104103

105104
local function removeChildren(self)

Basalt/objects/Image.lua

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ return function(name, basalt)
147147
loadImage = function(self, path)
148148
if(fs.exists(path))then
149149
local newBimg = images.loadBIMG(path)
150+
print(newBimg[1][1])
151+
sleep(1)
150152
bimgLibrary = bimg(newBimg)
151153
activeFrame = 1
152154
bimgFrame = bimgLibrary.getFrameObject(1)

0 commit comments

Comments
 (0)