Revert "Remove layout method from core::Renderer trait"
This reverts commit 2128472c2a.
This commit is contained in:
parent
98febd9a42
commit
cdce03cf7f
3 changed files with 32 additions and 9 deletions
|
|
@ -3,10 +3,13 @@ use crate::backend::{self, Backend};
|
|||
use crate::Primitive;
|
||||
|
||||
use iced_core::image;
|
||||
use iced_core::layout;
|
||||
use iced_core::renderer;
|
||||
use iced_core::svg;
|
||||
use iced_core::text::{self, Text};
|
||||
use iced_core::{Background, Color, Font, Point, Rectangle, Size, Vector};
|
||||
use iced_core::{
|
||||
Background, Color, Element, Font, Point, Rectangle, Size, Vector,
|
||||
};
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::marker::PhantomData;
|
||||
|
|
@ -85,6 +88,14 @@ impl<B: Backend, T> Renderer<B, T> {
|
|||
impl<B: Backend, T> iced_core::Renderer for Renderer<B, T> {
|
||||
type Theme = T;
|
||||
|
||||
fn layout<Message>(
|
||||
&mut self,
|
||||
element: &Element<'_, Message, Self>,
|
||||
limits: &layout::Limits,
|
||||
) -> layout::Node {
|
||||
element.as_widget().layout(self, limits)
|
||||
}
|
||||
|
||||
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self)) {
|
||||
let current = self.start_layer();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue