APIs missing: lines management
matteogratton opened this issue · 0 comments
Currently, it is pretty hard to handle lines.
They are a ShapePath
, with some extra info added on top of them:
closed: false
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.
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:
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.