This commit is contained in:
facile pop culture reference 2026-07-31 06:47:30 +03:00
parent 94c26f06cc
commit fc01fd6ad3
40 changed files with 2075 additions and 1807 deletions

24
src/layout/pull.rs Normal file
View file

@ -0,0 +1,24 @@
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!()
});