Skip to content

Introduce a tool that can be used to create and edit a paths #104

@sprocketc

Description

@sprocketc

We need to implement a tool that can be used to create paths under src/renderer/tool/impl/element/path.cljs. We also need to improve element.hierarchy/render-edit under src/renderer/element/impl/shape/path.cljs to allow editing paths (also see the d attribute spec).

We already have svgpath installed, that can be used to parse the segments from the d string attribute of the path, like (-> el :attrs :d svgpath .-segments), to get a list of segments like the following

[
    [
        "M",
        180.733125,
        76.48709375
    ],
    [
        "H",
        380.7687812499999
    ],
    [
        "V",
        173.03478124999998
    ],
    [
        "H",
        180.733125
    ],
    [
        "V",
        76.48709375
    ],
    [
        "z"
    ]
]

The complex part is that the feature requires bezier curve editing. We should use the circle-handle for the curve editing and the square-handle for the points, that live under renderer.tool.views.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions