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:
@@ -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(...)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user