From 95bcc5747c9fa849b2cb6e4205adc0f684176505 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 21 Apr 2015 17:13:15 -0700 Subject: [PATCH] Adding transparent white. Using helper color function (less verbose and clear to understand). --- components/gfx/color.rs | 5 +++++ components/layout/display_list_builder.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/gfx/color.rs b/components/gfx/color.rs index a91c6818ee6..f6fb0a7de3d 100644 --- a/components/gfx/color.rs +++ b/components/gfx/color.rs @@ -39,3 +39,8 @@ pub fn transparent_black() -> AzColor { pub fn white() -> AzColor { AzColor { r: 1.0, g: 1.0, b: 1.0, a: 1.0 } } + +#[inline] +pub fn transparent_white() -> AzColor { + AzColor { r: 1.0, g: 1.0, b: 1.0, a: 0.0 } +} diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index e92d0411216..7fcacac7713 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -1318,7 +1318,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow { ScrollPolicy::Scrollable }; - let transparent = color::rgba(1.0, 1.0, 1.0, 0.0); + let transparent = color::transparent_white(); let stacking_context = self.create_stacking_context(display_list, Some(Arc::new(PaintLayer::new(self.layer_id(0),