Method: View::WorkingSet#set_scroll_top

Defined in:
lib/view/working_set.rb

#set_scroll_top(value) ⇒ Object



145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/view/working_set.rb', line 145

def set_scroll_top(value)
  self.scroll_top = if value < 2
                      # Reached top
                      0
                    elsif (value + scrollable_height) > @scrollable_line_count
                      # Reached bottom
                      [@scrollable_line_count - scrollable_height, 0].max
                    else
                      # Normal scroll
                      value
                    end
end