-
Notifications
You must be signed in to change notification settings - Fork 150
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
WIP Use euclid crate for geometry types #1136
base: master
Are you sure you want to change the base?
Conversation
c0afa09
to
7344ba2
Compare
@@ -169,7 +169,7 @@ where | |||
} else { | |||
3 | |||
}; | |||
Rectangle::from_loc_and_size((0, 0), (24 * digits, 35)).to_f64() | |||
Rectangle::new((0, 0), (24 * digits, 35)).to_f64() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is actually a rect
method in euclid to make this even shorter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I guess the cases with origin
(0, 0)
should just be equivalent to Rect::from_size
.
Another thing Not sure how best to make use of things like With or without this change, |
This does not yet compile. It seems one difference between the Euclid types and the ones Smithay currently has is that `euclid`'s points cannot be added, and there's a seperate vector type. That is probably better for making sure code dealing with coordinates is correct. Though that will require some changes.
Another difference is that apparently casts in Probably as long as signed types are used, this would only be an issue if a client sent some extreme values. Edit: If needed |
This does not yet compile.
It seems one difference between the Euclid types and the ones Smithay currently has is that
euclid
's points cannot be added, and there's a seperate vector type. That is probably better for making sure code dealing with coordinates is correct. Though that will require some changes.