mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update euclid to 0.10.1
This commit is contained in:
parent
8a75810eba
commit
51768844ed
37 changed files with 281 additions and 280 deletions
|
@ -15,7 +15,7 @@ azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
|
|||
bitflags = "0.7"
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
cssparser = {version = "0.5.7", features = ["heap_size", "serde-serialization"]}
|
||||
euclid = "0.9"
|
||||
euclid = "0.10.1"
|
||||
fnv = "1.0"
|
||||
gfx = {path = "../gfx"}
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
|
|
|
@ -15,7 +15,7 @@ use azure::azure_hl::Color;
|
|||
use block::{BlockFlow, BlockStackingContextType};
|
||||
use canvas_traits::{CanvasMsg, CanvasData, FromLayoutMsg};
|
||||
use context::LayoutContext;
|
||||
use euclid::{Matrix4D, Point2D, Point3D, Rect, SideOffsets2D, Size2D};
|
||||
use euclid::{Matrix4D, Point2D, Point3D, Radians, Rect, SideOffsets2D, Size2D};
|
||||
use flex::FlexFlow;
|
||||
use flow::{BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED};
|
||||
use flow_ref;
|
||||
|
@ -1367,7 +1367,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
let matrix = match *operation {
|
||||
transform::ComputedOperation::Rotate(ax, ay, az, theta) => {
|
||||
let theta = 2.0f32 * f32::consts::PI - theta.radians();
|
||||
Matrix4D::create_rotation(ax, ay, az, theta)
|
||||
Matrix4D::create_rotation(ax, ay, az, Radians::new(theta))
|
||||
}
|
||||
transform::ComputedOperation::Perspective(d) => {
|
||||
create_perspective_matrix(d)
|
||||
|
@ -1385,14 +1385,15 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
m.to_gfx_matrix()
|
||||
}
|
||||
transform::ComputedOperation::Skew(theta_x, theta_y) => {
|
||||
Matrix4D::create_skew(theta_x.radians(), theta_y.radians())
|
||||
Matrix4D::create_skew(Radians::new(theta_x.radians()),
|
||||
Radians::new(theta_y.radians()))
|
||||
}
|
||||
};
|
||||
|
||||
transform = transform.mul(&matrix);
|
||||
transform = transform.pre_mul(&matrix);
|
||||
}
|
||||
|
||||
transform = pre_transform.mul(&transform).mul(&post_transform);
|
||||
transform = pre_transform.pre_mul(&transform).pre_mul(&post_transform);
|
||||
}
|
||||
|
||||
let perspective = match self.style().get_effects().perspective {
|
||||
|
@ -1413,7 +1414,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
|
||||
let perspective_matrix = create_perspective_matrix(d);
|
||||
|
||||
pre_transform.mul(&perspective_matrix).mul(&post_transform)
|
||||
pre_transform.pre_mul(&perspective_matrix).pre_mul(&post_transform)
|
||||
}
|
||||
LengthOrNone::None => {
|
||||
Matrix4D::identity()
|
||||
|
|
|
@ -493,7 +493,7 @@ pub trait ToGfxMatrix {
|
|||
|
||||
impl ToGfxMatrix for ComputedMatrix {
|
||||
fn to_gfx_matrix(&self) -> Matrix4D<f32> {
|
||||
Matrix4D::new(
|
||||
Matrix4D::row_major(
|
||||
self.m11 as f32, self.m12 as f32, self.m13 as f32, self.m14 as f32,
|
||||
self.m21 as f32, self.m22 as f32, self.m23 as f32, self.m24 as f32,
|
||||
self.m31 as f32, self.m32 as f32, self.m33 as f32, self.m34 as f32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue