diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-08-23 11:43:10 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-08-23 11:43:10 -0700 |
commit | 468b791050d9aa631871002e4fde70c3ea82bc0c (patch) | |
tree | 89a41873822c36eb0e63c118747aeabe7f430a7b /edit.lua | |
parent | 8057f3e8fe016ea054fa1c878e2c90b5ae32d1b6 (diff) | |
download | text.love-468b791050d9aa631871002e4fde70c3ea82bc0c.tar.gz |
flip return value of button handlers
This is compatible with Javascript, and it also seems like a better default; when people forget to think about return values in click handlers, they should be consumed.
Diffstat (limited to 'edit.lua')
-rw-r--r-- | edit.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua index 3c92d49..7a59ff3 100644 --- a/edit.lua +++ b/edit.lua @@ -163,7 +163,6 @@ function edit.draw(State) end schedule_save(State) record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)}) - return true -- don't handle any other events with this mouse button press end, }) end @@ -209,7 +208,7 @@ end function edit.mouse_pressed(State, x,y, mouse_button) if State.search_term then return end --? print('press', State.selection1.line, State.selection1.pos) - if propagate_to_button_handlers(State, x,y, mouse_button) then + if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then -- press on a button and it returned 'true' to short-circuit return end |