mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-21 04:53:24 +00:00
fix(nature/greenhouse): add limit to text offset for scrolling
This commit is contained in:
parent
45eb3d17e3
commit
e368ba3e0a
@ -35,9 +35,9 @@ end
|
||||
|
||||
function Greenhouse:scroll(direction)
|
||||
if direction == 'down' then
|
||||
self.offset = self.offset + 1
|
||||
self.offset = math.min(self.offset + 1, #self.lines)
|
||||
elseif direction == 'up' then
|
||||
self.offset = self.offset - 1
|
||||
self.offset = math.max(self.offset - 1, 1)
|
||||
end
|
||||
self:draw()
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user