aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/logical_geometry.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-01-20 15:38:14 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-01-20 16:31:01 +0100
commit90c0ec0cf77f37d2e3da838ee25bca137733f3ce (patch)
tree7d02a1e496343ee068e8416e3b996cadd4869c23 /components/style/logical_geometry.rs
parent05881b5ab4bf6f18d09763978ee5924a5b0dd895 (diff)
downloadservo-90c0ec0cf77f37d2e3da838ee25bca137733f3ce.tar.gz
servo-90c0ec0cf77f37d2e3da838ee25bca137733f3ce.zip
Fix servo build and rustfmt recent changes.
We need to introduce another Cursor enum that is specific to embedder_traits and that layout converts to to avoid dependency hell.
Diffstat (limited to 'components/style/logical_geometry.rs')
-rw-r--r--components/style/logical_geometry.rs29
1 files changed, 19 insertions, 10 deletions
diff --git a/components/style/logical_geometry.rs b/components/style/logical_geometry.rs
index 63aa5f138a4..dc6bae55461 100644
--- a/components/style/logical_geometry.rs
+++ b/components/style/logical_geometry.rs
@@ -172,17 +172,22 @@ impl WritingMode {
}
#[inline]
- fn physical_sides_to_corner(block_side: PhysicalSide, inline_side: PhysicalSide) -> PhysicalCorner {
+ fn physical_sides_to_corner(
+ block_side: PhysicalSide,
+ inline_side: PhysicalSide,
+ ) -> PhysicalCorner {
match (block_side, inline_side) {
- (PhysicalSide::Top, PhysicalSide::Left) |
- (PhysicalSide::Left, PhysicalSide::Top) => PhysicalCorner::TopLeft,
- (PhysicalSide::Top, PhysicalSide::Right) |
- (PhysicalSide::Right, PhysicalSide::Top) => PhysicalCorner::TopRight,
+ (PhysicalSide::Top, PhysicalSide::Left) | (PhysicalSide::Left, PhysicalSide::Top) => {
+ PhysicalCorner::TopLeft
+ },
+ (PhysicalSide::Top, PhysicalSide::Right) | (PhysicalSide::Right, PhysicalSide::Top) => {
+ PhysicalCorner::TopRight
+ },
(PhysicalSide::Bottom, PhysicalSide::Right) |
(PhysicalSide::Right, PhysicalSide::Bottom) => PhysicalCorner::BottomRight,
(PhysicalSide::Bottom, PhysicalSide::Left) |
(PhysicalSide::Left, PhysicalSide::Bottom) => PhysicalCorner::BottomLeft,
- _ => unreachable!("block and inline sides must be orthogonal")
+ _ => unreachable!("block and inline sides must be orthogonal"),
}
}
@@ -190,28 +195,32 @@ impl WritingMode {
pub fn start_start_physical_corner(&self) -> PhysicalCorner {
WritingMode::physical_sides_to_corner(
self.block_start_physical_side(),
- self.inline_start_physical_side())
+ self.inline_start_physical_side(),
+ )
}
#[inline]
pub fn start_end_physical_corner(&self) -> PhysicalCorner {
WritingMode::physical_sides_to_corner(
self.block_start_physical_side(),
- self.inline_end_physical_side())
+ self.inline_end_physical_side(),
+ )
}
#[inline]
pub fn end_start_physical_corner(&self) -> PhysicalCorner {
WritingMode::physical_sides_to_corner(
self.block_end_physical_side(),
- self.inline_start_physical_side())
+ self.inline_start_physical_side(),
+ )
}
#[inline]
pub fn end_end_physical_corner(&self) -> PhysicalCorner {
WritingMode::physical_sides_to_corner(
self.block_end_physical_side(),
- self.inline_end_physical_side())
+ self.inline_end_physical_side(),
+ )
}
#[inline]