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 upImplement a method `transform_rect` that transforms a rectangle and returns its bounding rect. #64
Conversation
|
|
||
| /// Returns the given point transformed by this matrix. | ||
| #[inline] | ||
| pub fn transform_point(&self, point: &Point2D<T>) -> Point2D<T> { |
This comment has been minimized.
This comment has been minimized.
| @@ -117,6 +117,21 @@ impl<T: Clone + PartialOrd + Add<T,T> + Sub<T,T>> Rect<T> { | |||
| } | |||
|
|
|||
| #[inline] | |||
| pub fn top_right(&self) -> Point2D<T> { | |||
This comment has been minimized.
This comment has been minimized.
glennw
Dec 23, 2014
Member
Shouldn't this be max_x, origin.y? Or am I misreading how the rect is defined? Ascii art?
returns its bounding rect. Because it returns the bounding rect, this is well-defined for rotations and skew. This is useful for creating temporary draw targets.
|
Rebased and issues addressed. r? @glennw |
|
Oops, ignore this; it doesn't build yet. Fixing. |
bors-servo
pushed a commit
to servo/servo
that referenced
this pull request
Mar 2, 2015
r? @mbrubeck Depends on servo/euclid#64.
bors-servo
pushed a commit
to servo/servo
that referenced
this pull request
Mar 2, 2015
r? @mbrubeck Depends on servo/euclid#64.
jrmuizel
pushed a commit
to jrmuizel/gecko-cinnabar
that referenced
this pull request
Jun 12, 2017
…ORATION-3 § 4 (from pcwalton:text-shadow); r=mbrubeck r? @mbrubeck Depends on servo/euclid#64. Source-Repo: https://github.com/servo/servo Source-Revision: 93d1f40a96df69eb9d38890df96c621e180d78cc
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Sep 30, 2019
…ORATION-3 § 4 (from pcwalton:text-shadow); r=mbrubeck r? mbrubeck Depends on servo/euclid#64. Source-Repo: https://github.com/servo/servo Source-Revision: 93d1f40a96df69eb9d38890df96c621e180d78cc UltraBlame original commit: a57e2aa6f1fc772980f59d1a10c32710e67586db
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Oct 1, 2019
…ORATION-3 § 4 (from pcwalton:text-shadow); r=mbrubeck r? mbrubeck Depends on servo/euclid#64. Source-Repo: https://github.com/servo/servo Source-Revision: 93d1f40a96df69eb9d38890df96c621e180d78cc UltraBlame original commit: a57e2aa6f1fc772980f59d1a10c32710e67586db
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Oct 1, 2019
…ORATION-3 § 4 (from pcwalton:text-shadow); r=mbrubeck r? mbrubeck Depends on servo/euclid#64. Source-Repo: https://github.com/servo/servo Source-Revision: 93d1f40a96df69eb9d38890df96c621e180d78cc UltraBlame original commit: a57e2aa6f1fc772980f59d1a10c32710e67586db
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.
pcwalton commentedDec 23, 2014
Because it returns the bounding rect, this is well-defined for rotations
and skew. This is useful for creating temporary draw targets.
r? @glennw