dedup points while loading drawing from disk

[?]
Sep 4, 2022, 2:22 AM
LE3OPXMNV3D2ZNZRPUT4D4ZGCS6UILAJPQBU5JHESABRSV5XFJ6AC

Dependencies

  • [2] VDJSUX2Q typos
  • [3] R3JZDBI2 drop heavyweight near check on file load/store
  • [4] KJQ5FEYV round coordinates to integers in a few places
  • [5] 2XLZCWZC bugfix: rectangles and squares are now saved
  • [6] VFJEVPPO bugfix: function names
  • [7] BYG5CEMV support for naming points
  • [8] KTZQ57HV replace globals with args in a few functions
  • [9] QYIFOHW3 first test!
  • [10] VTYCPKNH dead code
  • [11] VHQCNMAR several more modules
  • [12] YTSPVDZH first successful pagedown test, first bug found by test
  • [*] BLWAYPKV extract a module

Change contents

  • replacement in file.lua at line 64
    [5.1235][5.16586:16664](),[5.16586][5.16586:16664]()
    shape.p1 = Drawing.insert_point(drawing.points, shape.p1.x, shape.p1.y)
    [5.1235]
    [5.1236]
    shape.p1 = Drawing.find_or_insert_point(drawing.points, shape.p1.x, shape.p1.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 67
    [5.1306][5.16664:16742](),[5.16664][5.16664:16742]()
    shape.p2 = Drawing.insert_point(drawing.points, shape.p2.x, shape.p2.y)
    [5.1306]
    [5.1307]
    shape.p2 = Drawing.find_or_insert_point(drawing.points, shape.p2.x, shape.p2.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 72
    [5.1379][5.16825:16899](),[5.16825][5.16825:16899]()
    shape.vertices[i] = Drawing.insert_point(drawing.points, p.x,p.y)
    [5.1379]
    [5.1380]
    shape.vertices[i] = Drawing.find_or_insert_point(drawing.points, p.x,p.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 77
    [5.1472][5.16971:17060](),[5.16971][5.16971:17060]()
    shape.center = Drawing.insert_point(drawing.points, shape.center.x,shape.center.y)
    [5.1472]
    [2.10]
    shape.center = Drawing.find_or_insert_point(drawing.points, shape.center.x,shape.center.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 157
    [5.2341][5.2341:2419]()
    shape.p1 = Drawing.insert_point(drawing.points, shape.p1.x, shape.p1.y)
    [5.2341]
    [5.2419]
    shape.p1 = Drawing.find_or_insert_point(drawing.points, shape.p1.x, shape.p1.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 160
    [5.2489][5.2489:2567]()
    shape.p2 = Drawing.insert_point(drawing.points, shape.p2.x, shape.p2.y)
    [5.2489]
    [5.2567]
    shape.p2 = Drawing.find_or_insert_point(drawing.points, shape.p2.x, shape.p2.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 165
    [5.2776][5.2776:2850]()
    shape.vertices[i] = Drawing.insert_point(drawing.points, p.x,p.y)
    [5.2776]
    [5.2850]
    shape.vertices[i] = Drawing.find_or_insert_point(drawing.points, p.x,p.y, --[[large width to minimize overlap]] 1600)
  • replacement in file.lua at line 170
    [5.3013][5.3013:3102]()
    shape.center = Drawing.insert_point(drawing.points, shape.center.x,shape.center.y)
    [5.3013]
    [2.58]
    shape.center = Drawing.find_or_insert_point(drawing.points, shape.center.x,shape.center.y, --[[large width to minimize overlap]] 1600)
  • edit in drawing.lua at line 715
    [4.466][5.22708:22751](),[5.22708][5.22708:22751](),[5.22751][3.2135:2192]()
    function Drawing.insert_point(points, x,y)
    table.insert(points, {x=x, y=y})
    return #points
    end