镜像自地址
https://github.com/Hilbis/Hilbish
已同步 2025-07-03 01:32:03 +00:00
fix(nature/greenhouse): dont redraw if scroll pos stays the same
这个提交包含在:
父节点
bb9a6fe39e
当前提交
8b5b9b3c1c
@ -35,11 +35,14 @@ function Greenhouse:draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Greenhouse:scroll(direction)
|
function Greenhouse:scroll(direction)
|
||||||
|
local oldOffset = self.offset
|
||||||
if direction == 'down' then
|
if direction == 'down' then
|
||||||
self.offset = math.min(self.offset + 1, #self.lines)
|
self.offset = math.min(self.offset + 1, #self.lines)
|
||||||
elseif direction == 'up' then
|
elseif direction == 'up' then
|
||||||
self.offset = math.max(self.offset - 1, 1)
|
self.offset = math.max(self.offset - 1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.offset ~= oldOffset then self:draw() end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Greenhouse:update()
|
function Greenhouse:update()
|
||||||
|
正在加载...
x
在新工单中引用
屏蔽一个用户