clearer API for drawing a button

[?]
Oct 17, 2023, 5:53 AM
54HEXCWVCJ62P2BMXGTKBAR4GKOWJQ6MJUQ2PO5CLHDUOFAKCKEQC

Dependencies

  • [2] ZWDTEUH7 clean up some absolute coordinates
  • [3] CUFW4EJL reorganize app.lua and its comments
  • [4] PXSQR2AD hide line numbers from log browser
  • [5] BW2IUB3K keep all text cache writes inside text.lua
  • [6] ZTK4QTZT extract a couple of functions
  • [7] OI4FPFIN support drawings in the source editor
  • [8] NYRESFK6 source: show all files in navigator
  • [9] 7CLGG7J2 test: autosave after any shape
  • [10] AVTNUQYR basic test-enabled framework
  • [11] GZ5WULJV switch source side to new screen-line-based render
  • [12] ZQZX364V use a helper
  • [13] C2M4RUU5 reorganize some comments
  • [14] O2PYNFUB use existing local
  • [15] 3QWK3GSA support mouse clicks in file navigator
  • [16] XX7G2FFJ intermingle freehand line drawings with text
  • [17] AD34IX2Z couple more tests
  • [18] 3ZTODUBQ formatting
  • [19] ZCTJPR6I pass all button params to the icon
  • [20] KKMFQDR4 editing source code from within the app
  • [21] DLBD4ZA6 wait, fix tests
  • [22] WJBZZQE4 fold together two largely similar cases
  • [23] PP2IIHL6 stop putting button state in a global
  • [*] 2L5MEZV3 experiment: new edit namespace
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • replacement in source_text.lua at line 37
    [5.869][5.869:969]()
    button(State, 'link', {x=State.left+lo, y=y, w=hi-lo, h=State.line_height, color={1,1,1},
    [5.869]
    [5.969]
    button(State, 'link', {x=State.left+lo, y=y, w=hi-lo, h=State.line_height, bg={r=1,g=1,b=1},
  • replacement in source_edit.lua at line 191
    [4.573][4.573:648]()
    button(State, 'draw', {x=buttonx, y=y+4, w=12,h=12, color={1,1,0},
    [4.573]
    [5.20384]
    button(State, 'draw', {x=buttonx, y=y+4, w=12,h=12, bg={r=1,g=1,b=0},
  • replacement in edit.lua at line 186
    [5.269][2.103:195]()
    button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0},
    [5.269]
    [5.330]
    button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, bg={r=1,g=1,b=0},
  • replacement in commands.lua at line 119
    [5.206991][5.102:218]()
    button(Editor_state, 'menu', {x=x-5, y=y-2, w=width+5*2, h=Editor_state.line_height+2*2, color=colortable(color),
    [5.206991]
    [5.218]
    button(Editor_state, 'menu', {x=x-5, y=y-2, w=width+5*2, h=Editor_state.line_height+2*2, bg=color,
  • replacement in button.lua at line 15
    [5.296][5.2154:2230](),[5.2154][5.2154:2230]()
    love.graphics.setColor(params.color[1], params.color[2], params.color[3])
    [5.296]
    [5.2230]
    love.graphics.setColor(params.bg.r, params.bg.g, params.bg.b)
  • edit in app.lua at line 369
    [5.541][5.1467:1472](),[3.5233][5.1467:1472](),[5.1467][5.1467:1472](),[5.1472][3.5234:5327]()
    end
    function colortable(app_color)
    return {app_color.r, app_color.g, app_color.b, app_color.a}