mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-21 04:53:24 +00:00
fix(nature/greenhouse): dont redraw if scroll pos stays the same
This commit is contained in:
parent
bb9a6fe39e
commit
8b5b9b3c1c
@ -35,11 +35,14 @@ function Greenhouse:draw()
|
||||
end
|
||||
|
||||
function Greenhouse:scroll(direction)
|
||||
local oldOffset = self.offset
|
||||
if direction == 'down' then
|
||||
self.offset = math.min(self.offset + 1, #self.lines)
|
||||
elseif direction == 'up' then
|
||||
self.offset = math.max(self.offset - 1, 1)
|
||||
end
|
||||
|
||||
if self.offset ~= oldOffset then self:draw() end
|
||||
end
|
||||
|
||||
function Greenhouse:update()
|
||||
|
Loading…
x
Reference in New Issue
Block a user