mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Implement to_transform_3d_matrix for computing distance of mismatched transform lists.
We could use this method to convert a TransformList into a Matrix, and use this matrix for computing distance for Stylo and rendering the transform for Servo. This is an equivalent of nsStyleTransformMatrix::ReadTransforms in Gecko.
This commit is contained in:
parent
772a8464eb
commit
5c2d8507be
5 changed files with 215 additions and 146 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
//! Computed angles.
|
||||
|
||||
use euclid::Radians;
|
||||
use std::{f32, f64, fmt};
|
||||
use std::f64::consts::PI;
|
||||
use style_traits::ToCss;
|
||||
|
@ -112,3 +113,10 @@ impl ToCss for Angle {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Angle> for Radians<CSSFloat> {
|
||||
#[inline]
|
||||
fn from(a: Angle) -> Self {
|
||||
Radians::new(a.radians())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue