1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-17 16:57:39 +00:00

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

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(...)

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