mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 14:16:56 +02:00
24 lines
824 B
Rust
24 lines
824 B
Rust
use crate::{*, draw::*};
|
|
|
|
/// Move content in the negative direction of one or both axes.
|
|
///
|
|
/// ```
|
|
/// # fn doctest_layout_pull () -> Result<(), Box<dyn std::error::Error>> {
|
|
/// use tengri::{Layout, Draw, XYWH};
|
|
/// let area = XYWH(1u16, 1, 80, 25);
|
|
/// assert_eq!("1".layout(area)?, Some(XYWH(0u16, 0, 1, 1)));
|
|
/// assert_eq!("1".pull_x(1).layout(area)?, Some(XYWH(0u16, 1, 1, 1)));
|
|
/// assert_eq!("1".pull_y(1).layout(area)?, Some(XYWH(1u16, 0, 1, 1)));
|
|
/// assert_eq!("1".pull_xy(1, 1).layout(area)?, Some(XYWH(0u16, 0, 1, 1)));
|
|
/// # Ok(()) }
|
|
/// ```
|
|
pub enum Pull<T: Screen, I: Draw<T>, X: Into<Option<T::Unit>>> {
|
|
__(PhantomData<T>),
|
|
X(I, X),
|
|
Y(I, X),
|
|
XY(I, X, X),
|
|
}
|
|
|
|
impl_draw!(<T: Screen, I: Draw<T>, X: Into<Option<T::Unit>>,>|self: Pull<T, I, X>, _to: T|{
|
|
todo!()
|
|
});
|