mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: compiles and runs (not enabled yet)
This commit is contained in:
parent
ac3827b8f3
commit
98d2107e4e
15 changed files with 440 additions and 357 deletions
|
|
@ -20,7 +20,7 @@ impl<T> Align<T> {
|
|||
}
|
||||
|
||||
impl<E: Engine, T: Content<E>> Content<E> for Align<T> {
|
||||
fn content (&self) -> impl Content<E> {
|
||||
fn content (&self) -> impl Render<E> {
|
||||
&self.1
|
||||
}
|
||||
fn layout (&self, on: E::Area) -> E::Area {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ macro_rules! transform_xy {
|
|||
pub fn xy (item: T) -> Self { Self::XY(item) }
|
||||
}
|
||||
impl<E: Engine, T: Content<E>> Content<E> for $Enum<T> {
|
||||
fn content (&self) -> impl Content<E> {
|
||||
fn content (&self) -> impl Render<E> {
|
||||
match self {
|
||||
Self::X(item) => item,
|
||||
Self::Y(item) => item,
|
||||
|
|
@ -31,7 +31,7 @@ macro_rules! transform_xy {
|
|||
|
||||
transform_xy!(self: Fill |to|{
|
||||
let [x0, y0, wmax, hmax] = to.xywh();
|
||||
let [x, y, w, h] = Content::layout(&self.content(), to).xywh();
|
||||
let [x, y, w, h] = self.content().layout(to).xywh();
|
||||
match self {
|
||||
X(_) => [x0, y, wmax, h],
|
||||
Y(_) => [x, y0, w, hmax],
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ macro_rules! transform_xy_unit {
|
|||
}
|
||||
}
|
||||
impl<E: Engine, T: Content<E>> Content<E> for $Enum<E::Unit, T> {
|
||||
fn content (&self) -> impl Content<E> {
|
||||
fn content (&self) -> impl Render<E> {
|
||||
Some(match self {
|
||||
Self::X(_, content) => content,
|
||||
Self::Y(_, content) => content,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue