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

Replace exception when transforming to screen coordinates with gentler solution. #2079

Open
pantopela opened this issue May 8, 2024 · 1 comment

Comments

@pantopela
Copy link

Feature description

Currently, Axis.Transform(double x) throws for 'very large' screen coordinates (in debug mode only).

A 'softer' alternative (as this is not necessarily an error) would be to clamp to some very large value (1E5, for example).

@pantopela
Copy link
Author

#if DEBUG
            // clamp very large screen coordinates
            // May produce artifacts, but seems nicer than throwing

            s = Math.Max(-100000, Math.Min(s, 100000));

#endif

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

1 participant