mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
gfx: Round out when snapping rects to the nearest pixel.
Fixes `insert-inline-in-blocks-n-inlines-end-001` in the WPT tests.
This commit is contained in:
parent
24f10df436
commit
352ad53775
1 changed files with 6 additions and 1 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue