fix(nature/greenhouse): add limit to text offset for scrolling

pull/240/head
sammyette 2023-02-18 17:57:46 -04:00
parent 45eb3d17e3
commit e368ba3e0a
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 2 additions and 2 deletions

View File

@ -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