2023-11-18 12:20:09 +00:00
|
|
|
-- returns:
|
|
|
|
-- * a float between 0 and 1 regarding the relative position of the top line on screen
|
|
|
|
-- * a float between 0 and 1 regarding the relative position of the bottom line on screen
|
|
|
|
compute_scrollbar = function(state)
|
|
|
|
local top = state.line_cache[state.screen_top1.line].start_screen_line_index
|
2024-06-11 21:06:10 +01:00
|
|
|
local screen_bottom1 = Text.screen_bottom1(state)
|
|
|
|
local bot = state.line_cache[screen_bottom1.line].start_screen_line_index
|
2023-11-18 12:20:09 +00:00
|
|
|
return (top-1)/state.screen_line_count, bot/state.screen_line_count
|
|
|
|
end
|