-
Bug
-
Resolution: Fixed
-
P3
-
7u6
The recent work to add the Path2D.arcTo() method allowed the SVG parser to delete a significant amount of custom code, but they still need to do a fair amount of delegation and wrapping of the Path2D object to implement all of the relative coordinate methods and the smooth curve methods, both of which are trivial to implement on the Path2D object itself. They could completely eliminate any wrapping classes if Path2D provided the following methods (based loosely on the associated SVG path commands):
moveToRel(relx, rely)
lineToRel(relx, rely)
arcToRel(radiusx, radiusy, rot, largeArcs, sweep, relx, rely)
quadToRel(relx1, rely1, relx2, rely2)
curveToRel(relx1, rely1, relx2, rely2, relx3, rely3)
quadToSmooth(x2, y2) // infers x1,y1 from a reflection of the last curve control point
curveToSmooth(x2, y2, x3, y3) // also infers x1,y1 as quadToSmooth
quadToSmoothRel(relx2, rely2)
curveToSmoothRel(relx2, rely2, relx3, rely3)
moveToRel(relx, rely)
lineToRel(relx, rely)
arcToRel(radiusx, radiusy, rot, largeArcs, sweep, relx, rely)
quadToRel(relx1, rely1, relx2, rely2)
curveToRel(relx1, rely1, relx2, rely2, relx3, rely3)
quadToSmooth(x2, y2) // infers x1,y1 from a reflection of the last curve control point
curveToSmooth(x2, y2, x3, y3) // also infers x1,y1 as quadToSmooth
quadToSmoothRel(relx2, rely2)
curveToSmoothRel(relx2, rely2, relx3, rely3)