From f064f0482b653a1fbee4afbddcecf91e3a399004 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 16 Apr 2020 13:22:00 +0200 Subject: Introduce `Layer` trait --- native/src/renderer.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'native/src/renderer.rs') diff --git a/native/src/renderer.rs b/native/src/renderer.rs index a16df72b..29a091a4 100644 --- a/native/src/renderer.rs +++ b/native/src/renderer.rs @@ -25,7 +25,7 @@ mod null; #[cfg(debug_assertions)] pub use null::Null; -use crate::{layout, Element}; +use crate::{layout, Element, Rectangle}; /// A component that can take the state of a user interface and produce an /// output for its users. @@ -56,4 +56,11 @@ pub trait Renderer: Sized { ) -> layout::Node { element.layout(self, limits) } + + fn overlay( + &mut self, + base: Self::Output, + overlay: Self::Output, + overlay_bounds: Rectangle, + ) -> Self::Output; } -- cgit From 2118a726f8b6134820e1ca5b7b802fa1344e453a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 10 Jul 2020 02:39:12 +0200 Subject: Write documentation for the new `overlay` API --- native/src/renderer.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'native/src/renderer.rs') diff --git a/native/src/renderer.rs b/native/src/renderer.rs index 29a091a4..d986141f 100644 --- a/native/src/renderer.rs +++ b/native/src/renderer.rs @@ -57,6 +57,8 @@ pub trait Renderer: Sized { element.layout(self, limits) } + /// Overlays the `overlay` output with the given bounds on top of the `base` + /// output. fn overlay( &mut self, base: Self::Output, -- cgit