diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-07-06 13:55:56 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-07-07 15:01:17 -0700 |
commit | 352ad53775a4051c0bf965b3dbcde31410ce757c (patch) | |
tree | 9eb5fe0aa601cb25358bc9ef48339bc47083fc84 /components | |
parent | 24f10df436fdd1b6fdf197f76feb89135b72f25d (diff) | |
download | servo-352ad53775a4051c0bf965b3dbcde31410ce757c.tar.gz servo-352ad53775a4051c0bf965b3dbcde31410ce757c.zip |
gfx: Round out when snapping rects to the nearest pixel.
Fixes `insert-inline-in-blocks-n-inlines-end-001` in the WPT tests.
Diffstat (limited to 'components')
-rw-r--r-- | components/gfx/paint_context.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index df5e7a23552..62701cfb7dc 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -1171,7 +1171,12 @@ pub trait ToAzureRect { impl ToAzureRect for Rect<Au> { fn to_nearest_azure_rect(&self) -> Rect<AzFloat> { - Rect::new(self.origin.to_nearest_azure_point(), self.size.to_nearest_azure_size()) + let top_left = self.origin.to_nearest_azure_point(); + let bottom_right = self.bottom_right().to_nearest_azure_point(); + Rect::new(top_left, + Size2D::new((bottom_right.x - top_left.x) as AzFloat, + (bottom_right.y - top_left.y) as AzFloat)) + } fn to_azure_rect(&self) -> Rect<AzFloat> { Rect::new(self.origin.to_azure_point(), Size2D::new(self.size.width.to_f32_px(), |