[x] Create a PathSegment to represent different types of segments in path. This way, points and commands will be stored together.
[x] Refactor existing code to use this PathSegment.
[x] Cubic and Quadratic Beziers.
Steps to Test
Test new path representation
With new representation, all the old features should still be working.
Quadratic Curves
A click-drag-click action creates a CUBIC bezier.
A click-drag-click-drag . . . action creates QUADRATIC bezier.
Interconversion
Create a path using lines and curves and enter edit mode by double clicking on the canvas item.
Double click on any point. Curves should turn into lines and vice versa.
Note: Sometimes double click does not seem to have any effect. I think this is because of some issue of path in ItemManager.node_at_canvas_position but haven't pinpointed this issue.
Screenshots
Screenshot below shows 3 paths. The top left is made from lines only, the top right from CUBIC beziers.
The bottom-most is created using QUADRATIC beziers.
Summary / How this PR fixes the problem?
Steps to Test
Test new path representation
With new representation, all the old features should still be working.
Quadratic Curves
A click-drag-click action creates a CUBIC bezier. A click-drag-click-drag . . . action creates QUADRATIC bezier.
Interconversion
Create a path using lines and curves and enter edit mode by double clicking on the canvas item. Double click on any point. Curves should turn into lines and vice versa.
Note: Sometimes double click does not seem to have any effect. I think this is because of some issue of path in ItemManager.node_at_canvas_position but haven't pinpointed this issue.
Screenshots
Screenshot below shows 3 paths. The top left is made from lines only, the top right from CUBIC beziers. The bottom-most is created using QUADRATIC beziers.