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

offset fatalError when all control points of segments are the same #96

Open
typoland opened this issue Jun 27, 2021 · 3 comments
Open

Comments

@typoland
Copy link

As in tittle... sometimes happens, bcps are on points, points have same coordinates.
Example project: on github

@hfutrell
Copy link
Owner

hfutrell commented Jun 28, 2021

Hello. Thanks for the example. It looks like this is a problem in BezierCurve.outline(distance:). I'll fix that.

As a workaround I'd suggest checking if all the points in the curve are equal and if so doing some special handling like using a circular path with the proper radius, for example.

@typoland
Copy link
Author

Hello! For now i just tested if points are the same and if so, moved one of them by 0.001. :)

Btw. I could not found some .cgPath() function to convert BezierCurve to CGPath. Is it exist?

@hfutrell
Copy link
Owner

@typoland the BezierCurve type doesn't have a cgPath property but Path does, so you can do Path(curve: ...).cgPath instead.

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