Implement scrolling
This commit is contained in:
parent
cf009fd11e
commit
a1cea37cea
1 changed files with 6 additions and 0 deletions
|
@ -83,6 +83,12 @@ private
|
||||||
@active += 1
|
@active += 1
|
||||||
@active = 0 if @active >= @items.count
|
@active = 0 if @active >= @items.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @active < @top
|
||||||
|
@top = @active
|
||||||
|
elsif @active >= @top + @height
|
||||||
|
@top = @active - @height + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render
|
def render
|
||||||
|
|
Reference in a new issue