mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-17 15:56:57 +02:00
This commit is contained in:
parent
30d378a6ee
commit
bea88ac58d
5 changed files with 27 additions and 15 deletions
11
src/draw.rs
11
src/draw.rs
|
|
@ -90,11 +90,14 @@ pub const fn either <T: Screen> (condition: bool, a: impl Draw<T>, b: impl Draw<
|
|||
/// ```
|
||||
pub trait Screen: Space<Self::Unit> + Send + Sync + Sized {
|
||||
type Unit: Coord;
|
||||
/// Render drawable in area specified by `area`
|
||||
fn place <'t, T: Draw<Self> + ?Sized> (
|
||||
&mut self, content: &'t T, area: Option<XYWH<Self::Unit>>
|
||||
/// Render drawable in area.
|
||||
fn place <'t, T: Draw<Self> + ?Sized> (&mut self, content: &'t T) {
|
||||
self.place_at(self.xywh(), content)
|
||||
}
|
||||
/// Render drawable in subarea specified by `area`
|
||||
fn place_at <'t, T: Draw<Self> + ?Sized> (
|
||||
&mut self, area: XYWH<Self::Unit>, content: &'t T
|
||||
) {
|
||||
let area = area.unwrap_or_else(||self.xywh());
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue