diff options
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r-- | components/layout/fragment.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 14265aed4bc..4c3d3bdc4c6 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -327,15 +327,21 @@ impl ImageFragmentInfo { /// Returns the original inline-size of the image. pub fn image_inline_size(&mut self) -> Au { let size = self.image.get_size(self.replaced_image_fragment_info.for_node).unwrap_or(Size2D::zero()); - Au::from_px(if self.replaced_image_fragment_info.writing_mode_is_vertical { size.height } - else { size.width }) + Au::from_px(if self.replaced_image_fragment_info.writing_mode_is_vertical { + size.height + } else { + size.width + } as isize) } /// Returns the original block-size of the image. pub fn image_block_size(&mut self) -> Au { let size = self.image.get_size(self.replaced_image_fragment_info.for_node).unwrap_or(Size2D::zero()); - Au::from_px(if self.replaced_image_fragment_info.writing_mode_is_vertical { size.width } - else { size.height }) + Au::from_px(if self.replaced_image_fragment_info.writing_mode_is_vertical { + size.width + } else { + size.height + } as isize) } /// Tile an image |