mouse events for scrollbar
Dependencies
- [2]
UEG224LHdebug animations - [3]
MZ3DMYPDstart sketching out a scrollbar - [4]
D4FEFHQCflesh out Readme - [5]
ZM7NOBRMnew fork: carousel shell - [6]
Q434NJPRMerge lines.love - [7]
KKMFQDR4editing source code from within the app - [8]
WKKABOJ6one issue less - [9]
36Z442IVback to commit 8123959e52f without code editing - [10]
5RUFNRJOstart of the visual skeleton - [11]
25V2GA6Jtaking stock - [12]
3G723RV5Merge text.love - [13]
4FKRF2E4remove a stale issue - [14]
VYAFKS7RMerge lines.love - [*]
FS2ITYYHrecord a known issue - [*]
R5QXEHUIsomebody stop me
Change contents
- edit in README.md at line 68
* No scrollbars yet. That stuff is hard. - resolve order conflict in README.md at line 68
- file addition: 0040-on_editor_scrollbar_area[17.2]
on_editor_scrollbar_area = function(x,y)if x < Editor_state.right+20 then return endif x > Editor_state.right+40 then return endif y < Editor_state.top then return endif y > Editor_state.bottom then return endreturn trueend - file addition: 0038-on_editor_scrollbar[17.2]
on_editor_scrollbar = function(x,y)if x < Editor_state.right+20 then return endif x > Editor_state.right+40 then return endif y < Editor_scrollbar_top then return endif y > Editor_scrollbar_bottom then return endreturn trueend - file addition: 0037-Editor_scrollbar_top[17.2]
Editor_scrollbar_top = 0 -- in pxEditor_scrollbar_bottom = 0 - file addition: 0036-adjust_scrollbar[17.2]
adjust_scrollbar = function(y)local s = (y-Editor_state.top) / (Editor_state.bottom-Editor_state.top)local screen_line = s*Editor_state.screen_line_countlocal line = 1for i=1,#Editor_state.lines doif Editor_state.line_cache[i].start_screen_line_index > screen_line thenbreakendline = iendEditor_state.screen_top1 = {line=line, pos=1}Editor_state.cursor1 = {line=line, pos=1}end - edit in 0034-draw_scrollbar at line 11
Editor_scrollbar_top = topyEditor_scrollbar_bottom = boty - replacement in 0017-on.mouse_release at line 2
edit.mouse_release(Editor_state, x,y, mouse_button)if Editor_scrollbar_drag thenadjust_scrollbar(y)Editor_scrollbar_drag = nilelseif on_editor_scrollbar_area(x,y) thenadjust_scrollbar(y)elseedit.mouse_release(Editor_state, x,y, mouse_button)end - replacement in 0016-on.mouse_press at line 5
edit.mouse_press(Editor_state, x,y, mouse_button)if on_editor_scrollbar(x,y) thenEditor_scrollbar_drag = trueelseif on_editor_scrollbar_area(x,y) then-- nothingelseedit.mouse_press(Editor_state, x,y, mouse_button)end - replacement in 0004-on.update at line 3
end[2.1760]if Editor_scrollbar_drag thenadjust_scrollbar(App.mouse_y())endend