mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
separate Input and Output impls
This commit is contained in:
parent
a6efde40f8
commit
0e821e098f
77 changed files with 465 additions and 454 deletions
|
|
@ -3,7 +3,7 @@ use crate::*;
|
|||
/// Defines an enum that transforms its content
|
||||
/// along either the X axis, the Y axis, or both.
|
||||
///
|
||||
/// The `_Unused` variant wraps the `Engine` type
|
||||
/// The `_Unused` variant wraps the `Output` type
|
||||
/// using `PhantomData` to permit the double generic.
|
||||
macro_rules! transform_xy {
|
||||
($self:ident : $Enum:ident |$to:ident|$area:expr) => {
|
||||
|
|
@ -13,15 +13,15 @@ macro_rules! transform_xy {
|
|||
pub fn y (item: T) -> Self { Self::Y(item) }
|
||||
pub fn xy (item: T) -> Self { Self::XY(item) }
|
||||
}
|
||||
impl<E: Engine, T: Content<E>> Content<E> for $Enum<T> {
|
||||
impl<E: Output, T: Content<E>> Content<E> for $Enum<T> {
|
||||
fn content (&self) -> impl Render<E> {
|
||||
match self {
|
||||
Self::X(item) => item,
|
||||
Self::Y(item) => item,
|
||||
Self::XY(item) => item,
|
||||
Self::XY(item) => item
|
||||
}
|
||||
}
|
||||
fn layout (&$self, $to: <E as Engine>::Area) -> <E as Engine>::Area {
|
||||
fn layout (&$self, $to: <E as Output>::Area) -> <E as Output>::Area {
|
||||
use $Enum::*;
|
||||
$area
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue