Rename Matrix2D/4D into Transform2D/3D#194
Conversation
|
r? @nox |
| pub type Degrees<T> = Length<T, Deg>; | ||
|
|
||
| /// Temporary alias to facilitate the transition to the new naming scheme | ||
| pub type Matrix2D<T> = Transform2D<T>; |
There was a problem hiding this comment.
Perhaps, we should put #[deprecated] on top? See rust-lang/rust#29935
src/transform2d.rs
Outdated
|
|
||
| define_matrix! { | ||
| /// A 2d transform stored as a 2 by 3 matrix in row-major order in memory, | ||
| /// A 2d transform stored as a 2 by 3 transform in row-major order in memory, |
There was a problem hiding this comment.
I think this should stay as matrix
| @@ -18,51 +18,51 @@ use trig::Trig; | |||
| use std::fmt; | |||
|
|
|||
| define_matrix! { | |||
There was a problem hiding this comment.
It's the same macro used with points and other euclid types, so I think it's fine to leave it as matrix.
There was a problem hiding this comment.
I wonder if we even still need this, given now serde_derive is stable and comes with knobs to change the default deriving behaviour, we should look into simplifying it before 1.0.
src/transform2d.rs
Outdated
| /// For example, `TypedTransform2D<f32, WordSpace, ScreenSpace>::transform_point4d` | ||
| /// takes a `TypedPoint2D<f32, WordSpace>` and returns a `TypedPoint2D<f32, ScreenSpace>`. | ||
| /// | ||
| /// Matrices expose a set of convenience methods for pre- and post-transformations. |
src/transform2d.rs
Outdated
| pub fn row_major(m11: T, m12: T, m21: T, m22: T, m31: T, m32: T) -> TypedMatrix2D<T, Src, Dst> { | ||
| TypedMatrix2D { | ||
| impl<T: Copy, Src, Dst> TypedTransform2D<T, Src, Dst> { | ||
| /// Create a transform specifying its components in row-major order. |
There was a problem hiding this comment.
specifying its matrix elements in row-major mode
|
Thanks @kvark, I addressed the review comments (except for the macro name). |
kvark
left a comment
There was a problem hiding this comment.
Thanks!
If we don't really need define_matrix!, we can deal with it as a follow-up.
|
@bors-servo r=kvark |
|
📌 Commit c409c9d has been approved by |
Rename Matrix2D/4D into Transform2D/3D Fixes #160. <!-- 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/194) <!-- Reviewable:end -->
|
☀️ Test successful - status-travis |
Fixes #160.
This change is