mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-17 15:56:57 +02:00
wip: text drawing impls
This commit is contained in:
parent
29035d0b36
commit
9c5bfafb7a
2 changed files with 15 additions and 8 deletions
21
src/draw.rs
21
src/draw.rs
|
|
@ -46,21 +46,26 @@ pub use self::screen::*;
|
|||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
pub trait Draw<T: Screen> {
|
||||
fn draw (self, to: &mut T) -> Usually<XYWH<T::Unit>>;
|
||||
pub trait Draw<S: Screen> {
|
||||
fn draw (self, to: &mut S) -> Usually<XYWH<S::Unit>>;
|
||||
}
|
||||
impl<T: Screen> Draw<T> for () {
|
||||
fn draw (self, __: &mut T) -> Usually<XYWH<T::Unit>> {
|
||||
impl<S: Screen> Draw<S> for () {
|
||||
fn draw (self, __: &mut S) -> Usually<XYWH<S::Unit>> {
|
||||
Ok(Default::default())
|
||||
}
|
||||
}
|
||||
impl<T: Screen, D: Draw<T>> Draw<T> for &D {
|
||||
fn draw (self, __: &mut T) -> Usually<XYWH<T::Unit>> {
|
||||
impl<S: Screen, D: Draw<S>> Draw<S> for &D {
|
||||
fn draw (self, __: &mut S) -> Usually<XYWH<S::Unit>> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
impl<T: Screen, D: Draw<T>> Draw<T> for Option<D> {
|
||||
fn draw (self, __: &mut T) -> Usually<XYWH<T::Unit>> {
|
||||
impl<S: Screen, D: Draw<S>> Draw<S> for Option<D> {
|
||||
fn draw (self, __: &mut S) -> Usually<XYWH<S::Unit>> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
impl<S: Screen, D: Draw<S>> Draw<S> for RwLock<D> {
|
||||
fn draw (self, __: &mut S) -> Usually<XYWH<S::Unit>> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue