Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRename Matrix2D/4D into Transform2D/3D #194
Merged
Conversation
|
r? @nox |
src/lib.rs
Outdated
| @@ -110,3 +110,13 @@ pub type Radians<T> = Length<T, Rad>; | |||
|
|
|||
| /// A value in Degrees. | |||
| pub type Degrees<T> = Length<T, Deg>; | |||
|
|
|||
| /// Temporary alias to facilitate the transition to the new naming scheme | |||
| pub type Matrix2D<T> = Transform2D<T>; | |||
This comment has been minimized.
This comment has been minimized.
src/transform2d.rs
Outdated
| @@ -18,51 +18,51 @@ use trig::Trig; | |||
| use std::fmt; | |||
|
|
|||
| 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, | |||
This comment has been minimized.
This comment has been minimized.
| @@ -18,51 +18,51 @@ use trig::Trig; | |||
| use std::fmt; | |||
|
|
|||
| define_matrix! { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nical
May 20, 2017
Author
Collaborator
It's the same macro used with points and other euclid types, so I think it's fine to leave it as matrix.
This comment has been minimized.
This comment has been minimized.
nox
May 20, 2017
Member
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
| /// useful to represent 2d transformations. | ||
| /// | ||
| /// Matrices can be parametrized over the source and destination units, to describe a | ||
| /// transformation from a space to another. | ||
| /// For example, `TypedMatrix2D<f32, WordSpace, ScreenSpace>::transform_point4d` | ||
| /// 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. |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
|
Thanks @kvark, I addressed the review comments (except for the macro name). |
|
Thanks! |
|
@bors-servo r=kvark |
|
|
bors-servo
added a commit
that referenced
this pull request
May 21, 2017
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 -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
nical commentedMay 19, 2017
•
edited by larsbergstrom
Fixes #160.
This change is