From 41bd984d6bf629bf2e9e6c45c800ff2fd4bf75b2 Mon Sep 17 00:00:00 2001 From: cossonleo Date: Thu, 20 Jan 2022 11:10:07 +0800 Subject: component overlay position fix --- lazy/src/component.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lazy') diff --git a/lazy/src/component.rs b/lazy/src/component.rs index 2b729045..4136aa9f 100644 --- a/lazy/src/component.rs +++ b/lazy/src/component.rs @@ -263,14 +263,16 @@ where .build(), ); - cache.as_ref().unwrap().borrow_overlay().is_some() + cache + .as_ref() + .unwrap() + .borrow_overlay() + .as_ref() + .map(|overlay| overlay.position()) }); - has_overlay.then(|| { - overlay::Element::new( - layout.position(), - Box::new(Overlay { instance: self }), - ) + has_overlay.map(|pos| { + overlay::Element::new(pos, Box::new(Overlay { instance: self })) }) } } -- cgit