Rustfmt layout crate

This commit is contained in:
Pyfisch 2018-08-24 15:44:25 +02:00
parent 577830de90
commit 349047b096
37 changed files with 7177 additions and 4832 deletions

View file

@ -513,27 +513,29 @@ impl ClippingRegion {
/// This is a quick, not a precise, test; it can yield false positives.
#[inline]
pub fn might_intersect_point(&self, point: &LayoutPoint) -> bool {
self.main.contains(point) &&
self.complex
.iter()
.all(|complex| complex.rect.contains(point))
self.main.contains(point) && self
.complex
.iter()
.all(|complex| complex.rect.contains(point))
}
/// Returns true if this clipping region might intersect the given rectangle and false
/// otherwise. This is a quick, not a precise, test; it can yield false positives.
#[inline]
pub fn might_intersect_rect(&self, rect: &LayoutRect) -> bool {
self.main.intersects(rect) &&
self.complex
.iter()
.all(|complex| complex.rect.intersects(rect))
self.main.intersects(rect) && self
.complex
.iter()
.all(|complex| complex.rect.intersects(rect))
}
/// Returns true if this clipping region completely surrounds the given rect.
#[inline]
pub fn does_not_clip_rect(&self, rect: &LayoutRect) -> bool {
self.main.contains(&rect.origin) && self.main.contains(&rect.bottom_right()) &&
self.complex.iter().all(|complex| {
self.main.contains(&rect.origin) && self.main.contains(&rect.bottom_right()) && self
.complex
.iter()
.all(|complex| {
complex.rect.contains(&rect.origin) && complex.rect.contains(&rect.bottom_right())
})
}
@ -588,8 +590,7 @@ impl ClippingRegion {
rect: complex.rect.translate(delta),
radii: complex.radii,
mode: complex.mode,
})
.collect(),
}).collect(),
}
}