Skip to content
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 a method `transform_rect` that transforms a rectangle and returns its bounding rect. #64

Closed
wants to merge 1 commit into from

Conversation

@pcwalton
Copy link
Contributor

pcwalton commented Dec 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


/// Returns the given point transformed by this matrix.
#[inline]
pub fn transform_point(&self, point: &Point2D<T>) -> Point2D<T> {

This comment has been minimized.

@glennw

glennw Dec 23, 2014

Member

This doesn't take account of m12 (you've got m21 duplicated.)

@@ -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.

@glennw

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.
@pcwalton pcwalton force-pushed the pcwalton:transform-rect branch from 560eb57 to c9143bf Feb 24, 2015
@pcwalton
Copy link
Contributor Author

pcwalton commented Feb 24, 2015

Rebased and issues addressed. r? @glennw

@pcwalton pcwalton closed this Feb 24, 2015
@pcwalton
Copy link
Contributor Author

pcwalton commented Feb 24, 2015

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
bors-servo pushed a commit to servo/servo that referenced this pull request Mar 2, 2015
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.