Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg-path-parser returns outline #210

Open
sneko opened this issue Jul 1, 2024 · 1 comment
Open

svg-path-parser returns outline #210

sneko opened this issue Jul 1, 2024 · 1 comment

Comments

@sneko
Copy link

sneko commented Jul 1, 2024

Hi,

Here a straight line into Figma by using the VECTOR type:
image

The corresponding Figma SVG path is:
M0 0.5L34.5 0.5L34.5 -0.5L0 -0.5L0 0.5Z

It will result into a rectangle into Penpot:
image

This is due to svg-path-parser that will analyze the raw Figma SVG path, not understanding the shape was initially created with a strokeWeight (no matter the value). The main issue is to modify the shape, you need to manage close points so the shape stay a line. And it's even worse with curves because you need to also have the same angle for the both curve points.

I'm not sure of all possible cases from a SVG path but:

  • either it's always making a round for each "sub-shape" into the SVG path, and so we could skip the half of points (first or last ones)
  • or by using strokeWeight and strokeAlign from Figma, we could in a way try to match each point with it's "clone one" to merge them

(in both cases, strokeWeight and strokeAlign would help shifting the position of points since outlines where used initially, not the original centered line)

EDIT: I think by doing this, shape having a "close path" will have their fill property working, there will be not necessary to have 2 shapes inside a group, one for the stroke, one for the filling.

EDIT2: related https://forum.figma.com/t/rest-api-exposing-svg-real-strokes/42387 on Figma side but we no solution?

@Cenadros
Copy link
Collaborator

Hi there @sneko. I was not able to reproduce this by making lines in Figma. Could you please share a simple figma file with this example in which you're encountering this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants