Conversation
|
Sorry it's taken so long to respond. I don't think a single-segment approach can solve this: this PR makes the decision about whether to output the first dash segment when it reaches the end of the first path segment. But at that point we don't yet know whether the first path segment is part of a closed path or not. For example, consider this test case: The current PR will break this test, because it will issue the path (0, 0) -- (4, 0) -- (4, 1) first instead of joining it with the final dash. I wonder if a possible solution is to put the burden on the caller: we allow the caller to specify that they want the dashes reported eagerly, without a stash. |
|
@ankushKun are you actively thinking about this? Otherwise I might give an alternate solution a go. |
|
@RobertBrewitz Give it a go! I havent had the chance to look at this further :) |
Added a new
OutputStashThenWorkstate to theDashIteratorin stroke.rs to handle correct output order of stashed path segments. For open paths, the stash is output first and then it continues like usual, for closed paths the logic remains same.edit: fixes #528