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

Dashes = [0,0] ends up in infinite loop #4

Closed
rcoreilly opened this issue Nov 2, 2018 · 1 comment
Closed

Dashes = [0,0] ends up in infinite loop #4

rcoreilly opened this issue Nov 2, 2018 · 1 comment

Comments

@rcoreilly
Copy link
Contributor

if you scale down lines with dashes to a sufficiently small size, the fixed.Int26_6 version can end up being 0, at which point the Dasher rendering code in dash.go ends up stuck in an infinite loop!

Best soln would be to fix SetStroke to detect the problem and reset Dashes if all are 0.

I'm now catching this upstream, but would be good to fix here too.

@srwiley
Copy link
Owner

srwiley commented Nov 6, 2018

Good call Randy. If any one of the dash spaces is greater than zero it will work, so I put in a test in SetStroke to see if any of the dashes are positive. If none are, then it ignores the dashes. Plus I make it a little more idiomatic. Please get back to me if there is any problem.

@srwiley srwiley closed this as completed Nov 6, 2018
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