Skip to content

Commit

Permalink
Auto merge of #466 - nical:perspective-doc, r=kvark
Browse files Browse the repository at this point in the history
Improve the documentation of Transform3D::perspective

There was a bit of confusion about the formulation of the perspective transform in #465. This clarifies things.
  • Loading branch information
bors-servo authored Aug 21, 2020
2 parents 27b7a27 + a8dfc57 commit 4264949
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "euclid"
version = "0.22.0"
version = "0.22.1"
authors = ["The Servo Project Developers"]
edition = "2018"
description = "Geometry primitives"
Expand Down
4 changes: 3 additions & 1 deletion src/transform3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,16 @@ where
)
}

/// Create a simple perspective projection transform:
/// Create a simple perspective transform, projecting to the plane `z = -d`.
///
/// ```text
/// 1 0 0 0
/// 0 1 0 0
/// 0 0 1 -1/d
/// 0 0 0 1
/// ```
///
/// See <https://drafts.csswg.org/css-transforms-2/#PerspectiveDefined>.
pub fn perspective(d: T) -> Self
where
T: Neg<Output = T> + Div<Output = T>,
Expand Down

0 comments on commit 4264949

Please sign in to comment.