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

clamp here could not always give the correct value #27

Open
zenodante opened this issue Mar 8, 2021 · 2 comments
Open

clamp here could not always give the correct value #27

zenodante opened this issue Mar 8, 2021 · 2 comments

Comments

@zenodante
Copy link

int16_t x = lol::clamp(int(x0), -1, 128);

@zenodante
Copy link
Author

The slop of the line would be wrong after clamp.

@samhocevar
Copy link
Owner

That value should not affect the slope of the line, which is always (y1 - y0) / (x1 - x0), but I see how it can offset the whole line. Thanks for pointing this out!

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