mirror of
https://github.com/kepler155c/opus
synced 2026-09-20 16:12:07 +00:00
fix ui resizing (due to canvas changes)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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