add state arg to Drawing.draw

[?]
Jul 12, 2022, 11:25 PM
7JH2ZT3FCW4WX52IJFSLGRVZWQQVYJXULSQM2BM4BJUZWG3IVGKAC

Dependencies

  • [2] LNUHQOGH start passing in Editor_state explicitly
  • [3] AJB4LFRB try to maintain a reasonable line width
  • [4] JFFUF5AL override mouse state lookups in tests
  • [5] GSPXUEQO .
  • [6] HOSPP2AN crisp font rendering
  • [7] DRFE3B3Z mouse buttons are integers, not strings
  • [8] BLWAYPKV extract a module
  • [9] M6TH7VSZ rip out notion of Line_width
  • [10] 2L4DL7PG go through App in a couple more places
  • [11] K2X6G75Z start writing some tests for drawings
  • [12] NHA7RUFI move current mode indicator slightly
  • [13] LF7BWEG4 group all editor globals
  • [14] LAW2O3NW extract variable Margin_left
  • [15] 5DOTWNVM right margin
  • [16] WPW3AVFS more precise shape selection
  • [17] BYG5CEMV support for naming points
  • [18] XRLJDW3W casting about for more helpers to extract..
  • [19] AH744RFR show when we're naming a point
  • [20] H22OAXWE couple of TODOs
  • [21] 2L5MEZV3 experiment: new edit namespace
  • [22] LUNH47XX make text and drawings the same width
  • [23] C45WCXJ2 keep drawings within the line width slider as well
  • [24] 4KC7I3E2 make colors easier to edit
  • [25] NYQ7HD4D move
  • [26] VHQCNMAR several more modules
  • [27] 253TWKDA clean up
  • [28] YJGADSGK delete unused arg

Change contents

  • replacement in edit.lua at line 155
    [3.5396][3.5396:5421]()
    Drawing.draw(line)
    [3.5396]
    [2.3657]
    Drawing.draw(State, line)
  • replacement in drawing.lua at line 7
    [3.315][3.38:66](),[3.148][3.38:66]()
    function Drawing.draw(line)
    [3.315]
    [3.1533]
    function Drawing.draw(State, line)
  • replacement in drawing.lua at line 9
    [3.1580][3.127165:127281]()
    if pmx < App.screen.width-Editor_state.margin_right and pmy > line.y and pmy < line.y+Drawing.pixels(line.h) then
    [3.1580]
    [3.1026]
    if pmx < App.screen.width-State.margin_right and pmy > line.y and pmy < line.y+Drawing.pixels(line.h) then
  • replacement in drawing.lua at line 11
    [3.1052][3.127282:127573]()
    love.graphics.rectangle('line', Editor_state.margin_left,line.y, App.screen.width-Editor_state.margin_width,Drawing.pixels(line.h))
    if icon[Editor_state.current_drawing_mode] then
    icon[Editor_state.current_drawing_mode](App.screen.width-Editor_state.margin_right-22, line.y+4)
    [3.1052]
    [3.523]
    love.graphics.rectangle('line', State.margin_left,line.y, App.screen.width-State.margin_width,Drawing.pixels(line.h))
    if icon[State.current_drawing_mode] then
    icon[State.current_drawing_mode](App.screen.width-State.margin_right-22, line.y+4)
  • replacement in drawing.lua at line 15
    [3.532][3.127574:127678]()
    icon[Editor_state.previous_drawing_mode](App.screen.width-Editor_state.margin_right-22, line.y+4)
    [3.532]
    [3.589]
    icon[State.previous_drawing_mode](App.screen.width-State.margin_right-22, line.y+4)
  • replacement in drawing.lua at line 29
    [3.817][3.127679:127766]()
    local mx,my = Drawing.coord(pmx-Editor_state.margin_left), Drawing.coord(pmy-line.y)
    [3.817]
    [3.894]
    local mx,my = Drawing.coord(pmx-State.margin_left), Drawing.coord(pmy-line.y)
  • replacement in drawing.lua at line 38
    [3.1083][3.127767:127836]()
    Drawing.draw_shape(Editor_state.margin_left,line.y, line, shape)
    [3.1083]
    [3.1122]
    Drawing.draw_shape(State.margin_left,line.y, line, shape)
  • replacement in drawing.lua at line 44
    [3.1159][3.127837:127950]()
    love.graphics.circle('line', Drawing.pixels(p.x)+Editor_state.margin_left,Drawing.pixels(p.y)+line.y, 4)
    [3.1159]
    [3.1335]
    love.graphics.circle('line', Drawing.pixels(p.x)+State.margin_left,Drawing.pixels(p.y)+line.y, 4)
  • replacement in drawing.lua at line 47
    [3.1192][3.127951:128064]()
    love.graphics.circle('fill', Drawing.pixels(p.x)+Editor_state.margin_left,Drawing.pixels(p.y)+line.y, 2)
    [3.1192]
    [3.1521]
    love.graphics.circle('fill', Drawing.pixels(p.x)+State.margin_left,Drawing.pixels(p.y)+line.y, 2)
  • replacement in drawing.lua at line 51
    [3.37][3.128065:128162]()
    local x,y = Drawing.pixels(p.x)+Editor_state.margin_left+5, Drawing.pixels(p.y)+line.y+5
    [3.37]
    [3.8431]
    local x,y = Drawing.pixels(p.x)+State.margin_left+5, Drawing.pixels(p.y)+line.y+5
  • replacement in drawing.lua at line 53
    [3.8472][3.128163:128258]()
    if Editor_state.current_drawing_mode == 'name' and i == line.pending.target_point then
    [3.8472]
    [3.254]
    if State.current_drawing_mode == 'name' and i == line.pending.target_point then
  • replacement in drawing.lua at line 59
    [3.404][3.128259:128299]()
    name_text = Editor_state.em
    [3.404]
    [3.488]
    name_text = State.em
  • replacement in drawing.lua at line 63
    [3.596][3.128300:128395]()
    love.graphics.rectangle('fill', x,y, App.width(name_text), Editor_state.line_height)
    [3.596]
    [3.703]
    love.graphics.rectangle('fill', x,y, App.width(name_text), State.line_height)
  • replacement in drawing.lua at line 69
    [3.1279][3.128396:128464]()
    Drawing.draw_pending_shape(Editor_state.margin_left,line.y, line)
    [3.1279]
    [3.10]
    Drawing.draw_pending_shape(State.margin_left,line.y, line)