-
Notifications
You must be signed in to change notification settings - Fork 102
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
Implement some missing functionalities that would be useful in WebRender. #170
Conversation
3d78032
to
48096cd
Compare
I added |
@@ -215,6 +215,31 @@ where T: Copy + Clone + Zero + PartialOrd + PartialEq + Add<T, Output=T> + Sub<T | |||
pub fn translate_by_size(&self, size: &TypedSize2D<T, U>) -> TypedRect<T, U> { | |||
self.translate(&TypedPoint2D::new(size.width, size.height)) | |||
} | |||
|
|||
/// Returns the smallest rectangle containing the four points. |
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.
Four?
@@ -760,6 +760,18 @@ impl<T: ApproxEq<T>, U> ApproxEq<T> for TypedPoint4D<T, U> { | |||
} | |||
} | |||
|
|||
pub fn point2<T: Copy, U>(x: T, y: T) -> TypedPoint2D<T, U> { |
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.
Meh.
@bors-servo r+ |
📌 Commit 48096cd has been approved by |
⚡ Test exempted - status |
Implement some missing functionalities that would be useful in WebRender. to_untyped and from_untyped ease the conversion between TypedRect/Size/Point/Matrix objects and their UnknownUnit default counterparts. Most types already have these methods but it is currently missing from Matrix4D. r? @glennw <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/170) <!-- Reviewable:end -->
Oh I guess webrender was updated to use the new from_points, but the one in our quantum branch is still using the old webrender. Updating everything together should fix the issue I'm having. (But still, I think this PR deserved a non-minor version bump as it can cause bustage) |
to_untyped and from_untyped ease the conversion between TypedRect/Size/Point/Matrix objects and their UnknownUnit default counterparts. Most types already have these methods but it is currently missing from Matrix4D.
r? @glennw
This change is