aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/logical_geometry.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2016-08-11 00:29:19 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-08-12 03:12:06 +0200
commit6259df5e2da6574f3d5951a7df2cb511d263697a (patch)
treef68cc95e507fc7e208a3c04de637c0914bcd9d60 /components/style/logical_geometry.rs
parentb7facf41cbc7ba727666e95fd0c390d432d862fa (diff)
downloadservo-6259df5e2da6574f3d5951a7df2cb511d263697a.tar.gz
servo-6259df5e2da6574f3d5951a7df2cb511d263697a.zip
Update to euclid 0.8
Diffstat (limited to 'components/style/logical_geometry.rs')
-rw-r--r--components/style/logical_geometry.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/components/style/logical_geometry.rs b/components/style/logical_geometry.rs
index 2b41b512910..71a7dda8bc7 100644
--- a/components/style/logical_geometry.rs
+++ b/components/style/logical_geometry.rs
@@ -301,9 +301,9 @@ impl<T: Copy> LogicalSize<T> {
pub fn to_physical(&self, mode: WritingMode) -> Size2D<T> {
self.debug_writing_mode.check(mode);
if mode.is_vertical() {
- Size2D { width: self.block, height: self.inline }
+ Size2D::new(self.block, self.inline)
} else {
- Size2D { width: self.inline, height: self.block }
+ Size2D::new(self.inline, self.block)
}
}
@@ -450,15 +450,13 @@ impl<T: Copy + Sub<T, Output=T>> LogicalPoint<T> {
pub fn to_physical(&self, mode: WritingMode, container_size: Size2D<T>) -> Point2D<T> {
self.debug_writing_mode.check(mode);
if mode.is_vertical() {
- Point2D {
- x: if mode.is_vertical_lr() { self.b } else { container_size.width - self.b },
- y: if mode.is_inline_tb() { self.i } else { container_size.height - self.i }
- }
+ Point2D::new(
+ if mode.is_vertical_lr() { self.b } else { container_size.width - self.b },
+ if mode.is_inline_tb() { self.i } else { container_size.height - self.i })
} else {
- Point2D {
- x: if mode.is_bidi_ltr() { self.i } else { container_size.width - self.i },
- y: self.b
- }
+ Point2D::new(
+ if mode.is_bidi_ltr() { self.i } else { container_size.width - self.i },
+ self.b)
}
}
@@ -953,8 +951,8 @@ impl<T: Copy + Add<T, Output=T> + Sub<T, Output=T>> LogicalRect<T> {
}
}
Rect {
- origin: Point2D { x: x, y: y },
- size: Size2D { width: width, height: height },
+ origin: Point2D::new(x, y),
+ size: Size2D::new(width, height),
}
}