fix ui resizing (due to canvas changes)

This commit is contained in:
kepler155c@gmail.com
2019-02-26 18:03:09 -05:00
parent ad60fce9b0
commit cc1a2bfbf4
6 changed files with 49 additions and 27 deletions
+1
View File
@@ -263,6 +263,7 @@ function Manager:click(target, code, button, x, y)
if clickEvent.element.focus then
target:setFocus(clickEvent.element)
end
_G._p = clickEvent
self:inputEvent(clickEvent.element, clickEvent)
target:sync()
+7 -5
View File
@@ -5,11 +5,13 @@ UI.ActiveLayer = class(UI.Window)
UI.ActiveLayer.defaults = {
UIElement = 'ActiveLayer',
}
function UI.ActiveLayer:setParent()
self:layout(self)
self.canvas = self:addLayer()
UI.Window.setParent(self)
function UI.ActiveLayer:layout()
UI.Window.layout(self)
if not self.canvas then
self.canvas = self:addLayer()
else
self.canvas:resize(self.width, self.height)
end
end
function UI.ActiveLayer:enable(...)
+7
View File
@@ -32,6 +32,13 @@ function UI.Embedded:setParent()
self.win.clear()
end
function UI.Embedded:layout()
UI.Window.layout(self)
if self.win then
self.win.reposition(self.x, self.y, self.width, self.height)
end
end
function UI.Embedded:draw()
self.canvas:dirty()
end