-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add compareTo operator for XInt/YInt #63
Labels
good first issue
Good for newcomers
Comments
That feels like an omission - seems like it'd be a good addition (for XInt/YInt/XFloat/YFloat) |
@dimsuz a PR would definitely be welcome, otherwise I or someone else might try to get to it over the next week or two? |
Yep, I'll post one unless someone beats me to it. operator fun compareTo(other: XInt): Int {
return this.value.compareTo(other.value)
} etc |
I will do it right now |
Released in 0.1.7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are certain scenarios (like the one described in #59) in which it is handy to do something like this:
Currently
XInt
/YInt
lackoperator fun compareTo
which prevents the above from compiling.The workaround could be to use
minOf(view1.bottom() - view2.bottom(), 0.ydip) == 0.ydip
but that's a bit ugly.Can those be added (I can forge a PR) or do you have something specific in mind why this is not a good idea?
The text was updated successfully, but these errors were encountered: