experiment: switch mouse icon over buttons

akkartik
Oct 26, 2025, 5:24 AM
AIVC47JFEUSZUEMCRG75ZRBA7BUTZLUDWFF64KNPW4V5OG5EBSAQC

Dependencies

  • [2] 2Y5GGGJ4 correct a mis-named threshold
  • [3] PP2IIHL6 stop putting button state in a global
  • [*] 2L5MEZV3 experiment: new edit namespace
  • [*] LF7BWEG4 group all editor globals
  • [*] LNUHQOGH start passing in Editor_state explicitly
  • [*] PJEQCTBL add state arg to Drawing.update
  • [*] XX7G2FFJ intermingle freehand line drawings with text

Change contents

  • edit in edit.lua at line 22
    [2.103]
    [5.436]
    Hand_icon = love.mouse.getSystemCursor('hand')
    Arrow_icon = love.mouse.getSystemCursor('arrow')
  • edit in edit.lua at line 106
    [6.97864]
    [6.97864]
    button_handlers = {},
  • edit in edit.lua at line 212
    [7.4252]
    [8.15]
    local x, y = love.mouse.getPosition()
    if mouse_hover_on_any_button(State, x,y) then
    love.mouse.setCursor(Hand_icon)
    else
    love.mouse.setCursor(Arrow_icon)
    end
  • edit in button.lua at line 18
    [3.343]
    [9.2405]
    end
    function mouse_hover_on_any_button(State, x, y)
    for _,ev in ipairs(State.button_handlers) do
    if x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h then
    if ev.onpress1 then
    return true
    end
    end
    end