no, make the scrollbar easier to acquire

This commit is contained in:
Kartik K. Agaram 2023-11-18 05:44:39 -08:00
parent cef7497e48
commit 5444db930f
4 changed files with 7 additions and 6 deletions

View File

@ -7,7 +7,7 @@ draw_scrollbar = function(Editor_state)
local topy = Editor_state.top + sbtop*(Editor_state.bottom - Editor_state.top)
local boty = Editor_state.top +sbbot*(Editor_state.bottom - Editor_state.top)
App.color{r=0.6, g=0.6, b=0.8, a=0.5}
love.graphics.rectangle('fill', Editor_state.right+20, topy, 20, boty-topy)
love.graphics.rectangle('fill', Editor_state.right+15, topy, 30, boty-topy)
Editor_scrollbar_top = topy
Editor_scrollbar_bottom = boty
end

View File

@ -1,6 +1,6 @@
on_editor_scrollbar = function(x,y)
if x < Editor_state.right+20 then return end
if x > Editor_state.right+40 then return end
if x < Editor_state.right+15 then return end
if x > Editor_state.right+45 then return end
if y < Editor_scrollbar_top then return end
if y > Editor_scrollbar_bottom then return end
return true

View File

@ -1,6 +1,6 @@
on_editor_scrollbar_area = function(x,y)
if x < Editor_state.right+20 then return end
if x > Editor_state.right+40 then return end
if x < Editor_state.right+15 then return end
if x > Editor_state.right+45 then return end
if y < Editor_state.top then return end
if y > Editor_state.bottom then return end
return true

View File

@ -113,7 +113,8 @@ function edit.draw(State, fg, hide_cursor)
assert(false)
end
if not Text.le1(State.screen_top1, State.cursor1) then
State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
assert(false)
end
State.cursor_x = nil
State.cursor_y = nil