Support transforms for display list optimization. Prevents clipping in #6643.

This commit is contained in:
Glenn Watson 2015-08-05 11:33:08 +10:00
parent b9f00190e1
commit 11b1c19b05
7 changed files with 134 additions and 91 deletions

View file

@ -290,3 +290,8 @@ pub fn f32_rect_to_au_rect(rect: Rect<f32>) -> Rect<Au> {
Size2D::new(Au::from_f32_px(rect.size.width), Au::from_f32_px(rect.size.height)))
}
/// A helper function to convert a rect of `Au` pixels to a rect of f32 units.
pub fn au_rect_to_f32_rect(rect: Rect<Au>) -> Rect<f32> {
Rect::new(Point2D::new(rect.origin.x.to_f32_px(), rect.origin.y.to_f32_px()),
Size2D::new(rect.size.width.to_f32_px(), rect.size.height.to_f32_px()))
}