1
0
mirror of https://github.com/kepler155c/opus synced 2025-01-03 20:30:28 +00:00

checkbox width bug, scroll canvas

This commit is contained in:
kepler155c@gmail.com 2019-02-09 21:41:51 -05:00
parent 195dbd365a
commit fd672ac74e
2 changed files with 12 additions and 5 deletions

View File

@ -824,12 +824,19 @@ function UI.Window:scrollIntoView()
parent:draw() parent:draw()
end end
-- TODO: fix
local function setOffset(y)
parent.offy = y
if parent.canvas then
parent.canvas.offy = parent.offy
end
parent:draw()
end
if self.y <= parent.offy then if self.y <= parent.offy then
parent.offy = math.max(0, self.y - 1) setOffset(math.max(0, self.y - 1))
parent:draw()
elseif self.y + self.height > parent.height + parent.offy then elseif self.y + self.height > parent.height + parent.offy then
parent.offy = self.y + self.height - parent.height - 1 setOffset(self.y + self.height - parent.height - 1)
parent:draw()
end end
end end

View File

@ -24,7 +24,7 @@ function UI.Checkbox:setParent()
if not self.width and not self.ex then if not self.width and not self.ex then
self.width = (self.label and #self.label or 0) + 3 self.width = (self.label and #self.label or 0) + 3
else else
self.widthh = 3 self.width = 3
end end
UI.Window.setParent(self) UI.Window.setParent(self)
end end