mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
document stuff; Thunk suffix -> prefix
This commit is contained in:
parent
f9f9051eb7
commit
9d250daa04
16 changed files with 162 additions and 125 deletions
|
|
@ -1,3 +1,24 @@
|
|||
//! Aligns things to the container. Comes with caveats.
|
||||
//! ```
|
||||
//! let four = ||Fixed::<TuiOut, _, _>::xy(4, 4, unit);
|
||||
//! test(area, &Align::nw(four()), [10, 10, 4, 4]);
|
||||
//! test(area, &Align::n(four()), [18, 10, 4, 4]);
|
||||
//! test(area, &Align::ne(four()), [26, 10, 4, 4]);
|
||||
//! test(area, &Align::e(four()), [26, 18, 4, 4]);
|
||||
//! test(area, &Align::se(four()), [26, 26, 4, 4]);
|
||||
//! test(area, &Align::s(four()), [18, 26, 4, 4]);
|
||||
//! test(area, &Align::sw(four()), [10, 26, 4, 4]);
|
||||
//! test(area, &Align::w(four()), [10, 18, 4, 4]);
|
||||
//! let two_by_four = ||Fixed::<TuiOut, _, _>::xy(4, 2, unit);
|
||||
//! test(area, &Align::nw(two_by_four()), [10, 10, 4, 2]);
|
||||
//! test(area, &Align::n(two_by_four()), [18, 10, 4, 2]);
|
||||
//! test(area, &Align::ne(two_by_four()), [26, 10, 4, 2]);
|
||||
//! test(area, &Align::e(two_by_four()), [26, 19, 4, 2]);
|
||||
//! test(area, &Align::se(two_by_four()), [26, 28, 4, 2]);
|
||||
//! test(area, &Align::s(two_by_four()), [18, 28, 4, 2]);
|
||||
//! test(area, &Align::sw(two_by_four()), [10, 28, 4, 2]);
|
||||
//! test(area, &Align::w(two_by_four()), [10, 19, 4, 2]);
|
||||
//! ```
|
||||
use crate::*;
|
||||
#[derive(Debug, Copy, Clone, Default)] pub enum Alignment { #[default] Center, X, Y, NW, N, NE, E, SE, S, SW, W }
|
||||
pub struct Align<A>(Alignment, A);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue