make freehand drawings smoother

[?]
Jul 5, 2022, 6:32 PM
65HNIAOSEEJPYMO5XJBDMLU27X5XD3UJIDGSOS2IZ7CIYQRBOZ2QC

Dependencies

Change contents

  • replacement in drawing.lua at line 119
    [3.1852][3.1860:1909](),[3.1860][3.1860:1909]()
    Drawing.draw_shape(left,top, drawing, shape)
    [3.1852]
    [3.1909]
    local shape_copy = deepcopy(shape)
    Drawing.smoothen(shape_copy)
    Drawing.draw_shape(left,top, drawing, shape_copy)
  • edit in drawing.lua at line 296
    [10.399]
    [2.124]
    Drawing.smoothen(drawing.pending)
  • edit in drawing.lua at line 676
    [11.21499]
    [11.21499]
    end
    end
    function Drawing.smoothen(shape)
    assert(shape.mode == 'freehand')
    for _=1,7 do
    for i=2,#shape.points-1 do
    local a = shape.points[i-1]
    local b = shape.points[i]
    local c = shape.points[i+1]
    b.x = (a.x + b.x + c.x)/3
    b.y = (a.y + b.y + c.y)/3
    end