make freehand drawings smoother
[?]
Jul 5, 2022, 6:32 PM
65HNIAOSEEJPYMO5XJBDMLU27X5XD3UJIDGSOS2IZ7CIYQRBOZ2QCDependencies
- [2]
SRVDX4I5local var - [3]
WTDKUACNrectangle and square shapes - [4]
PTT4K4EUuse the provided args everywhere - [5]
NYQ7HD4Dmove - [6]
XRLJDW3Wcasting about for more helpers to extract.. - [7]
JFFUF5ALoverride mouse state lookups in tests - [*]
BLWAYPKVextract a module - [*]
6DE7RBZ6move mouse_released events to Drawing - [*]
VHQCNMARseveral more modules
Change contents
- replacement in drawing.lua at line 119
Drawing.draw_shape(left,top, drawing, shape)local shape_copy = deepcopy(shape)Drawing.smoothen(shape_copy)Drawing.draw_shape(left,top, drawing, shape_copy) - edit in drawing.lua at line 296
Drawing.smoothen(drawing.pending) - edit in drawing.lua at line 676[11.21499][11.21499]
endendfunction Drawing.smoothen(shape)assert(shape.mode == 'freehand')for _=1,7 dofor i=2,#shape.points-1 dolocal a = shape.points[i-1]local b = shape.points[i]local c = shape.points[i+1]b.x = (a.x + b.x + c.x)/3b.y = (a.y + b.y + c.y)/3end