Replaced ZERO_RECT with Rect::zero()

This commit is contained in:
Alexander Mankuta 2015-12-03 15:39:30 +02:00
parent 8b95d7b8d8
commit 546d2f564f
6 changed files with 8 additions and 22 deletions

View file

@ -43,7 +43,7 @@ use style::properties::ComputedValues;
use text::TextRun;
use text::glyph::CharIndex;
use util::cursor::Cursor;
use util::geometry::{self, MAX_RECT, ZERO_RECT};
use util::geometry::{self, MAX_RECT};
use util::linked_list::prepend_from;
use util::mem::HeapSizeOf;
use util::opts;
@ -1043,7 +1043,7 @@ impl ClippingRegion {
#[inline]
pub fn empty() -> ClippingRegion {
ClippingRegion {
main: ZERO_RECT,
main: Rect::zero(),
complex: Vec::new(),
}
}
@ -1073,7 +1073,7 @@ impl ClippingRegion {
#[inline]
pub fn intersect_rect(self, rect: &Rect<Au>) -> ClippingRegion {
ClippingRegion {
main: self.main.intersection(rect).unwrap_or(ZERO_RECT),
main: self.main.intersection(rect).unwrap_or(Rect::zero()),
complex: self.complex,
}
}

View file

@ -35,7 +35,7 @@ use std::{f32, mem, ptr};
use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
use text::TextRun;
use text::glyph::CharIndex;
use util::geometry::{self, MAX_RECT, PagePx, ScreenPx, ZERO_POINT, ZERO_RECT};
use util::geometry::{self, MAX_RECT, PagePx, ScreenPx, ZERO_POINT};
use util::opts;
use util::range::Range;
@ -1580,7 +1580,7 @@ impl<'a> PaintContext<'a> {
let side_inflation = blur_radius * BLUR_INFLATION_FACTOR;
let tile_box_bounds =
geometry::f32_rect_to_au_rect(self.page_rect.to_untyped()).intersection(box_bounds)
.unwrap_or(ZERO_RECT)
.unwrap_or(Rect::zero())
.inflate(side_inflation, side_inflation);
TemporaryDrawTarget::from_bounds(&self.draw_target, &tile_box_bounds)
}