bug fixes and updates
This commit is contained in:
parent
43e307295e
commit
8615cb7edc
@ -18,7 +18,7 @@ setmetatable(element, {
|
||||
self = setmetatable({}, element)
|
||||
self.parentFunc = func
|
||||
|
||||
self:new(param,nil, w, h)
|
||||
self:new(param,nil, w, h, flags)
|
||||
self:createProxies()
|
||||
|
||||
---@type Element
|
||||
@ -213,6 +213,11 @@ function element:setParam(p)
|
||||
self.context:bubbleUpdate()
|
||||
end
|
||||
|
||||
function element:setSize(w, h)
|
||||
self.view.w = w or self.view.w
|
||||
self.view.h = h or self.view.h
|
||||
end
|
||||
|
||||
function element:setCalculatedSize(w, h)
|
||||
self.view.minW = w or self.view.minW
|
||||
self.view.minH = h or self.view.minH
|
||||
@ -312,7 +317,9 @@ function element:externalRender()
|
||||
if self.settings.hasCanvas then
|
||||
lg.translate(self.view.x, self.view.y)
|
||||
setColor(1, 1, 1, 1)
|
||||
lg.setBlendMode('alpha','premultiplied')
|
||||
draw(self.canvas, self.quad, 0, 0)
|
||||
lg.setBlendMode('alpha','alphamultiply')
|
||||
end
|
||||
|
||||
lg.setScissor()
|
||||
@ -320,6 +327,7 @@ function element:externalRender()
|
||||
end
|
||||
|
||||
function element:externalUpdate()
|
||||
self.context:set()
|
||||
self.context:zIndex()
|
||||
if not self.settings.failedCanvas
|
||||
and self.settings.testRenderPasses == 0
|
||||
@ -355,6 +363,7 @@ function element:externalUpdate()
|
||||
self.deferRepos = false
|
||||
end
|
||||
|
||||
self.context:unset()
|
||||
return self.settings.remove
|
||||
end
|
||||
|
||||
|
||||
@ -167,11 +167,11 @@ function subscription:emit(...)
|
||||
end
|
||||
|
||||
function subscription:checkInside(x, y)
|
||||
return x>self.x and x<self.x+self.w and y>self.y and y<self.y+self.h
|
||||
return x>self.stack.absX and x<self.stack.absX+self.w and y>self.stack.absY and y<self.stack.absY+self.h
|
||||
end
|
||||
|
||||
function subscription:checkOutside(x, y)
|
||||
return not (x>self.x and x<self.x+self.w and y>self.y and y<self.y+self.h)
|
||||
return not (x>self.stack.absX and x<self.stack.absX+self.w and y>self.stack.absY and y<self.stack.absY+self.h)
|
||||
end
|
||||
|
||||
---@alias InputMouseClickSubscriptionCallback fun(x:number, y:number, mouseButton:string)
|
||||
|
||||
@ -11,5 +11,5 @@ return function (callback)
|
||||
activeContext.element.callbacks.onUpdate = {}
|
||||
end
|
||||
|
||||
activeContext.element.callbacks.onUpdate[activeContext.element.callbacks.onUpdate+1] = callback
|
||||
activeContext.element.callbacks.onUpdate[#activeContext.element.callbacks.onUpdate+1] = callback
|
||||
end
|
||||
@ -1,4 +1,4 @@
|
||||
local path = string.sub(..., 1, string.len(...) - string.len(".control.size"))
|
||||
local path = string.sub(..., 1, string.len(...) - string.len(".hooks.setPos"))
|
||||
local stack = require(path..'.core.stack')
|
||||
|
||||
--Sets the relative position
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
local path = string.sub(..., 1, string.len(...) - string.len(".control.size"))
|
||||
local path = string.sub(..., 1, string.len(...) - string.len(".hooks.setSize"))
|
||||
local stack = require(path..'.core.stack')
|
||||
|
||||
--Sets the computed/minimum size of an element to be used with layout calculations and rendering
|
||||
return function(w, h)
|
||||
local currentStack = stack.getContext()
|
||||
currentStack.element:setCalculatedSize(w, h)
|
||||
currentStack.element:setSize(w, h)
|
||||
end
|
||||
@ -187,7 +187,6 @@ function grid:draw(xRoot, yRoot, width, height, children)
|
||||
if (not autoRows) and (not autoCols) then
|
||||
|
||||
if self.gridLayout.layout then
|
||||
|
||||
local layout = {}
|
||||
--flip layout table
|
||||
for x = 1, #self.gridLayout.layout[1] do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user