akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 202 forks source link

Refactor Path Segment Representation #708

Closed AshishS-1123 closed 1 year ago

AshishS-1123 commented 2 years ago

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.

refactor