Merge upstream into main

[?]
Jul 21, 2022, 12:14 AM
BCRJ6MHLYM6H4R7NXR2JD6SHQQJILLQIJE73LACRCLIPSHOHVNWQC

Dependencies

  • [2] 2RO7JXUC Merge upstream into main
  • [3] 7S6CIN7I Merge upstream into main
  • [4] 3OTESDW6 move drawing.starty into line cache
  • [5] XNFTJHC4 split keyboard handling between Text and Drawing
  • [6] DRFE3B3Z mouse buttons are integers, not strings
  • [7] OWK3U6VD tests for drawing polygons
  • [8] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [9] 2JLVAYHB start decoupling editor tests from App
  • [10] W7JMT5V2 rip out most support for polygons
  • [11] KTZQ57HV replace globals with args in a few functions
  • [12] R3JZDBI2 drop heavyweight near check on file load/store
  • [13] LAW2O3NW extract variable Margin_left
  • [14] BLWAYPKV extract a module
  • [15] 6DE7RBZ6 move mouse_released events to Drawing
  • [16] WDMPH4AN drop support for squares
  • [17] DDXXXXBR new mode for polygons
  • [18] 23MA4T3G add state arg to Drawing.keychord_pressed
  • [19] 7CEOB56D Merge upstream into main
  • [20] VHQCNMAR several more modules
  • [21] 7JH2ZT3F add state arg to Drawing.draw
  • [22] DR5XD5JQ per-polygon icons
  • [23] NYQ7HD4D move
  • [24] LF7BWEG4 group all editor globals
  • [25] LNUHQOGH start passing in Editor_state explicitly
  • [26] 3HVBAZPA add state arg to a few functions
  • [27] 7DYUAOI6 test: undo moving point
  • [28] OEUU62GM Merge upstream into main
  • [29] 4AXV2HG4 all pending manual tests done!
  • [30] 4CTZOJPC stop pretending globals are local
  • [31] WTDKUACN rectangle and square shapes
  • [32] YCDYGEZU include drawing index in a few places
  • [33] SRVDX4I5 local var
  • [34] QXVD2RIF add state arg to Drawing.mouse_released
  • [35] P5QNVXSN drop final mention of state global beyond main.lua
  • [36] 4KC7I3E2 make colors easier to edit
  • [37] UHB4GARJ left/right margin -> left/right coordinates
  • [38] TGZAJUEF bring back a set of constants
  • [*] K2X6G75Z start writing some tests for drawings

Change contents

  • resurrect zombie in drawing_tests.lua at line 244
    [4.1120][5.113425:113589](),[5.3148][5.113425:113589](),[5.27688][5.113425:113589](),[5.27688][5.113425:113589](),[5.113425][5.113425:113589](),[5.3148][5.113425:113589]()
    check_eq(Editor_state.lines[1].h, 128, 'F - test_draw_polygon/baseline/y')
    check_eq(#Editor_state.lines[1].shapes, 0, 'F - test_draw_polygon/baseline/#shapes')
  • edit in drawing_tests.lua at line 670
    [5.2215][5.502:502](),[5.116845][4.1380:1499](),[5.116845][4.1380:1499]()
    check_eq(Editor_state.line_cache[1].starty, Editor_state.top+Drawing_padding_top, 'F - test_draw_square/baseline/y')
  • resolve order conflict in drawing_tests.lua at line 670
    [5.2215]
  • replacement in drawing.lua at line 76
    [5.1279][5.4637:4711](),[5.1279][4.2279:2357]()
    Drawing.draw_pending_shape(State, line, line.y, State.left,State.right)
    Drawing.draw_pending_shape(line, line_cache.starty, State.left,State.right)
    [5.1279]
    [5.10]
    Drawing.draw_pending_shape(State, line, line_cache.starty, State.left,State.right)
  • resurrect zombie in drawing.lua at line 210
    [5.3639][5.6239:6240](),[5.3639][5.6239:6240]()
  • resolve order conflict in drawing.lua at line 211
    [5.6240]
    [4.2358]
  • replacement in drawing.lua at line 347
    [5.3948][5.7001:7105]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-drawing.y, State.width)
    [5.3948]
    [5.7105]
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
  • edit in drawing.lua at line 423
    [5.7671][5.306:359](),[5.596][5.306:359](),[5.467][5.2537:2661](),[5.467][5.2537:2661](),[5.690][4.4158:4354](),[5.690][4.4158:4354]()
    local _,drawing = Drawing.current_drawing(State)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-drawing.y, State.width)
    local _,drawing,line_cache = Drawing.current_drawing(State)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-line_cache.starty, State.width)
  • resurrect zombie in drawing.lua at line 423
    [5.936][4.4355:4551](),[5.936][4.4355:4551]()
    local _,drawing,line_cache = Drawing.current_drawing(State)
    local mx,my = Drawing.coord(App.mouse_x()-State.left, State.width), Drawing.coord(App.mouse_y()-line_cache.starty, State.width)
  • resurrect zombie in drawing.lua at line 425
    [5.2661][5.7963:8042](),[4.4551][5.7963:8042](),[5.39140][5.7963:8042](),[5.2661][5.7963:8042]()
    local j = Drawing.find_or_insert_point(drawing.points, mx,my, State.width)
  • edit in drawing.lua at line 728
    [5.1525][2.783:783](),[5.2366][4.3817:3931](),[5.2366][4.3817:3931](),[5.1231][4.3589:3701](),[5.1231][4.3589:3701](),[5.1231][4.3589:3701]()
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
    local mx,my = Drawing.coord(x-State.left, State.width), Drawing.coord(y-line_cache.starty, State.width)
  • resolve order conflict in drawing.lua at line 728
    [5.1525]