mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
use dynamic dispatch in render_in
This commit is contained in:
parent
ff6751d393
commit
c2e91fb432
2 changed files with 3 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ pub trait RenderTarget<E: Engine> {
|
||||||
-> E::Area;
|
-> E::Area;
|
||||||
fn area_mut (&mut self)
|
fn area_mut (&mut self)
|
||||||
-> &mut E::Area;
|
-> &mut E::Area;
|
||||||
fn render_in (&mut self, area: E::Area, widget: &impl Widget<Engine = E>)
|
fn render_in (&mut self, area: E::Area, widget: &dyn Widget<Engine = E>)
|
||||||
-> Perhaps<E::Area>;
|
-> Perhaps<E::Area>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,10 +55,9 @@ impl RenderTarget<Tui> for Tui {
|
||||||
#[inline] fn area_mut (&mut self) -> &mut <Self as Engine>::Area {
|
#[inline] fn area_mut (&mut self) -> &mut <Self as Engine>::Area {
|
||||||
&mut self.area
|
&mut self.area
|
||||||
}
|
}
|
||||||
#[inline] fn render_in (
|
#[inline] fn render_in (&mut self,
|
||||||
&mut self,
|
|
||||||
area: <Self as Engine>::Area,
|
area: <Self as Engine>::Area,
|
||||||
widget: &impl Widget<Engine = Self>
|
widget: &dyn Widget<Engine = Self>
|
||||||
) -> Perhaps<<Self as Engine>::Area> {
|
) -> Perhaps<<Self as Engine>::Area> {
|
||||||
let last = self.area();
|
let last = self.area();
|
||||||
*self.area_mut() = area;
|
*self.area_mut() = area;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue