Closed automata closed 10 years ago
Seems the problem resides in MakePath
. The following is supposed to work, but it doesn't:
Someone can say MakePath
is generating two separate paths (one for each point). But even when we group points together it still doesn't works:
Good question! :dromedary_camel:
I think it can be fixed by handling arrays here: https://github.com/noflo/noflo-canvas/blob/ddffd067a3729365b3a48e210a5b6a7ae7949a65/components/Draw.coffee#L141
OK no, the point array is already expanded in to multiple paths in MakePath via MakeCanvasPrimative.
This is the case where you want it to work like currently implemented, multiples paths, from one point to multiple points:
Yeah, you're right, it works following the "spread pattern". However, should we expect it works for only two points?
Maybe for count = 2
we have two moveTo
and no lineTo
?
2 points, or more, or combining points, curves, arcs...
Let's take it back to the data view.
:heavy_check_mark: This works to make 10 2-point paths: {},[]
(path (point 0 0)
(point (range 0 100 10) 100))
:x: This doesn't work now, but I'd expect it to make 1 2-point path: {},{}
(path (point 0 0)
(point 100 100))
:x: This doesn't work. Expected: 1 10-point path: []
(path (point (range 0 200 10) (random 0 200 10)))
OK, made a compute
override for MakePath and a bunch of test cases. We should make sure this MakeCanvasPrimative
issue doesn't apply elsewhere.
Testing @forresto's fix with basic shapes (useful to extend our existing shapes creating subgraphs like MakeTriangle
).
So "spread" is default and if we want a group of points/arcs/curves we should use Group
, right? I'm very satisfied with this semantics for MakePath
.
Group isn't needed there; I was just testing that one array of points would work the same as multiple points.
It's better than what I imagined. So it makes a segment to any received points/arcs/curves and knows how to deal with spreads too.
Just working with
MakeRange -> MakePoint
.