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

APIs missing: lines management #894

Open
matteogratton opened this issue Jul 11, 2022 · 0 comments
Open

APIs missing: lines management #894

matteogratton opened this issue Jul 11, 2022 · 0 comments

Comments

@matteogratton
Copy link

Currently, it is pretty hard to handle lines.

They are a ShapePath, with some extra info added on top of them:

  1. closed: false
  2. points: {} (with different settings here)

The main issue is related to the points, as they are handled in % of the size (from 0 to 1) and not as a position:
for a shape with X=100, Y=100, width=100 and height=100, the top-right point is

point: {
  pointType: "Straight",
  curveFrom: {}
  point: {x=1, y=0}
  curveTo: {}
}

which makes the manipulation of shapes and lines pretty hard if it involves other transformations and or changes with the size of the original shape.

For example:
Artboard

In this case, the point 1 coordinates are [50,50], but in the code, they are [0,0] in respect of the shape itself. Point 2 is [150,150] and [1,0].

If I manipulate point 1 to be in a different position, like:
Artboard
point 2 is still [150,150], but not in [1,0] anymore. It is [1,0.33].

This makes any kind of manipulation of points rather complex, as for any movement of one point, the actual % of the others' positions changes.

It would be nice to be able to choose between an absolute position [150,150] and a relative position [1,1] accordingly to the necessities.

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