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
Possible Infinite Loop in LineAnnotation.GetPoints() when ActualMinimum=ActualMaximum #1029
Comments
That´s an interesting axis :-) There should be an example in the ExampleLibrary with start and end position at zero. |
Can I take this one? |
Feel free to take it. The "interesting" axis was a simple trick to hide it. I think there is a "IsVisible" property, too - not sure why I did it this way. However, infinite loops are a no-go (even if you're "holding it wrong") and easy to avoid, too. Great library nevertheless 🥇 |
…k if ActualMaximumX==ActualMinimumX for non-curved lines.
Steps to reproduce
Platform: any
.NET version: any
Expected behaviour
No exception is thrown. Infinite loops have to be avoided at all times either by checking the increment or using a maximum iteration count.
Actual behaviour
When either the X or Y Axis are not instances of LinearAxis (thus, bool curvedLine is true), the line annotation produces not two but many points in LineAnnotation.GetPoints(). It produces an infinite "while (true)" loop because the increment is zero because ActualMaximum=ActualMinimum.
The result is a OutOfMemoryException:
Suggested Fix Strategy
When ActualMaximum=ActualMinimum the GetPoints() method can quickly return an empty result.
The text was updated successfully, but these errors were encountered: