layout docs: try something

This commit is contained in:
🪞👃🪞 2025-01-03 23:08:25 +01:00
parent f81a04dd44
commit fc82d6ff9b

View file

@ -6,20 +6,36 @@ and are generic over `tek_engine::Engine`
and `tek_engine::Content`. chiefly, they and `tek_engine::Content`. chiefly, they
are not dependent on rendering framework. are not dependent on rendering framework.
* `Fill` is to make the content's dimension equal to the container's. |operator|description|
* `Fixed` is to assign a fixed dimension to its content. |-|-|
* `Shrink`/`Expand` are to change the dimension of the content |**`When(x, a)`**|render `a` only when `x == true`|
* `Min`/`Max` are to constrain the dimension of the content |**`Either(x, a, b)`**|render `a` when `x == true`, otherwise render `b`|
* `Push`/`Pull` are to move the content along the axis |**`Map(get_iterator, callback)`**|transform items in uniform way|
* `Margin`/`Padding` are to change the dimension proportionally |**`Bsp`**|concatenative layout|
* `Align` is to pin the content along the axis of the container |...|...|
* `When` is to render content conditionally |**`Align`**|pin content along axis|
* `Either` is to alternates between contents |...|...|
* `Map` is to transform each content |**`Fill`**|**make content's dimension equal to container's:**|
* `Reduce` is to transform all contents into one |`Fill::x(a)`|use container's width for content|
* and, finally, `Bsp` is to put 2 where there was 1. |`Fill::y(a)`|use container's height for content|
|`Fill::xy(a)`|use container's width and height for content|
|**`Fixed`**|**assign fixed dimension to content:**|
|`Fixed::x(w, a)`|use width `w` for content|
|`Fixed::y(w, a)`|use height `w` for content|
|`Fixed::xy(w, h, a)`|use width `w` and height `h` for content|
|**`Expand`/`Shrink`**|**change dimension of content:**|
|`Expand::x(n, a)`/`Shrink::x(n, a)`|increment/decrement width of content area by `n`|
|`Expand::y(n, a)`/`Shrink::y(n, a)`|increment/decrement height of content area by `m`|
|`Expand::xy(n, m, a)`/`Shrink::xy(n, m, a)`|increment/decrement width of content area by `n`, height by `m`|
|**`Min`/`Max`**|**constrain dimension of content:**|
|`Min::x(w, a)`/`Max::x(w, a)`|enforce minimum/maximum width `w` for content|
|`Min::y(h, a)`/`Max::y(h, a)`|enforce minimum/maximum height `h` for content|
|`Min::xy(w, h, a)`/`Max::xy(w, h, a)`|enforce minimum/maximum width `w` and height `h` for content|
|**`Push`/`Pull`**|**move content along axis:**|
|`Push::x(n, a)`/`Pull::x(n, a)`|increment/decrement `x` of content area|
|`Push::y(n, a)`/`Pull::y(n, a)`|increment/decrement `y` of content area|
|`Push::xy(n, m, a)`/`Pull::xy(n, m, a)`|increment/decrement `x` and `y` of content area|
**todo.** and then you're like, **todo:**
"but why are they generic over E in the first place * sensible `Margin`/`Padding`
and not, say, over E::Unit? that might even free up * `Reduce`
some space to implement for non-uint cosmologies...