diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-10-13 12:08:07 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-10-13 12:08:07 +0200 |
| commit | 463e4ebd8234da5e28700e9b22b6ef5f0dfef56f (patch) | |
| tree | 01f3961d6996de3ee8f9819c2792f6ee8c2a3c3d /src/layout/text.rs | |
| parent | 6f22e4f13c42f06b686a01fbdd28a0163e88ae77 (diff) | |
Refactor layout types 🚧
Diffstat (limited to 'src/layout/text.rs')
| -rw-r--r-- | src/layout/text.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/text.rs b/src/layout/text.rs index ecec0220..6cbe3b8e 100644 --- a/src/layout/text.rs +++ b/src/layout/text.rs @@ -17,7 +17,7 @@ pub struct TextContext<'a, 'p> { } /// Layout one piece of text without any breaks as one continous box. -pub fn layout(text: &str, ctx: TextContext) -> LayoutResult<BoxLayout> { +pub fn layout_text(text: &str, ctx: TextContext) -> LayoutResult<Layout> { let mut loader = ctx.loader.borrow_mut(); let mut actions = Vec::new(); @@ -88,7 +88,7 @@ pub fn layout(text: &str, ctx: TextContext) -> LayoutResult<BoxLayout> { actions.push(LayoutAction::WriteText(buffer)); } - Ok(BoxLayout { + Ok(Layout { dimensions: Size2D::new(width, Size::pt(ctx.style.font_size)), actions, debug_render: false, |
