mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-17 15:56:57 +02:00
wip: final simplify
This commit is contained in:
parent
90ebae0f26
commit
0b9e9c0696
21 changed files with 607 additions and 544 deletions
15
src/layout/area.rs
Normal file
15
src/layout/area.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct Area<S: Screen, T: Draw<S>>(Option<XYWH<S::Unit>>, T);
|
||||
|
||||
/// ```
|
||||
/// use tengri::*;
|
||||
/// let _ = area(None, "unareaed");
|
||||
/// let _ = area([1, 2, 3, 4], "southeast");
|
||||
/// let _ = area(Some([1, 2, 3, 4]), "southeast");
|
||||
/// ```
|
||||
pub fn area <S: Screen, T: Draw<S>, U: Into<Option<XYWH<S::Unit>>>> (
|
||||
origin: U, it: T
|
||||
) -> Area<S, T> {
|
||||
Area(origin.into(), it)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue