diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-03 00:12:09 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-03 00:12:09 +0100 |
| commit | aae67bd572ad86f4c57e364daa51a9dc883b8913 (patch) | |
| tree | 0aba021e0748ebad2197ea390385ec5f93ccbc6e /src/layout/text.rs | |
| parent | 1c40dc42e7bc7b799b77f06d25414aca59a044ba (diff) | |
Move and rename many things 🚛
Diffstat (limited to 'src/layout/text.rs')
| -rw-r--r-- | src/layout/text.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/layout/text.rs b/src/layout/text.rs index 56b2328e..cfd83372 100644 --- a/src/layout/text.rs +++ b/src/layout/text.rs @@ -8,11 +8,11 @@ use crate::shaping; /// A text node. #[derive(Clone, PartialEq)] -pub struct Text { +pub struct NodeText { /// The text. pub text: String, /// How to align this text node in its parent. - pub align: BoxAlign, + pub align: ChildAlign, /// The text direction. pub dir: Dir, /// The font size. @@ -23,15 +23,15 @@ pub struct Text { pub variant: FontVariant, } -impl Layout for Text { +impl Layout for NodeText { fn layout(&self, ctx: &mut LayoutContext, _: &Areas) -> Layouted { let mut env = ctx.env.borrow_mut(); - Layouted::Layout( + Layouted::Frame( shaping::shape( - &mut env.fonts, &self.text, self.dir, self.font_size, + &mut env.fonts, &self.families, self.variant, ), @@ -40,14 +40,14 @@ impl Layout for Text { } } -impl Debug for Text { +impl Debug for NodeText { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "Text({})", self.text) } } -impl From<Text> for LayoutNode { - fn from(text: Text) -> Self { +impl From<NodeText> for Node { + fn from(text: NodeText) -> Self { Self::Text(text) } } |
