flip return value of button handlers

[?]
Aug 23, 2022, 6:43 PM
K6DTOGOQG4YXWTFKHGZ3DIC23G5ZV3WQZQPRRDYIWEGLNQW6QDGQC

Dependencies

  • [2] PP2IIHL6 stop putting button state in a global
  • [3] WJBZZQE4 fold together two largely similar cases
  • [4] 2L5MEZV3 experiment: new edit namespace
  • [5] U76D4P36 fix a typo
  • [6] LNUHQOGH start passing in Editor_state explicitly
  • [7] OAHNWDYG .
  • [8] ZNLTRNNK highlight another global
  • [9] XX7G2FFJ intermingle freehand line drawings with text
  • [10] ILOA5BYF separate data structure for each line's cache data
  • [11] 6D5MOJS4 allow buttons to interrupt events
  • [12] BJ46QVIP improve explanation for buttons
  • [13] TGHAJBES use line cache for drawings as well
  • [14] PW2VGQWN indent

Change contents

  • edit in edit.lua at line 166
    [3.935][3.15:113]()
    return true -- don't handle any other events with this mouse button press
  • replacement in edit.lua at line 211
    [3.4647][2.114:179]()
    if propagate_to_button_handlers(State, x,y, mouse_button) then
    [3.4647]
    [3.172]
    if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
  • replacement in button.lua at line 3
    [3.117][3.117:203]()
    -- If the handler returns true, it'll prevent any further processing of the
    -- event.
    [3.117]
    [3.2080]
    -- If any applicable button handler returns true, it'll propagate the click to other handlers.
  • replacement in button.lua at line 17
    [3.2443][2.344:409]()
    function propagate_to_button_handlers(State, x, y, mouse_button)
    [3.2443]
    [2.409]
    function mouse_press_consumed_by_any_button_handler(State, x, y, mouse_button)
  • replacement in button.lua at line 24
    [3.66][3.258:287]()
    return ev.onpress1()
    [3.66]
    [3.88]
    return not ev.onpress1()