summaryrefslogtreecommitdiff
path: root/src/layout/tree.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-04 18:01:56 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-04 18:01:56 +0200
commit262a8fa36a09527b4e257c175b12c8437279cf66 (patch)
treeed7ef10b8f8bc1723eda5d1075ac9c09fb8b014f /src/layout/tree.rs
parent54e0da59e37c25f5b9f9cd8fbe162184debe521b (diff)
Refactor and move shaping out of the layout module ⛳
Diffstat (limited to 'src/layout/tree.rs')
-rw-r--r--src/layout/tree.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/layout/tree.rs b/src/layout/tree.rs
index 18156e97..dfc1c464 100644
--- a/src/layout/tree.rs
+++ b/src/layout/tree.rs
@@ -1,8 +1,8 @@
//! Layouting of syntax trees.
use super::line::{LineContext, LineLayouter};
-use super::shaping::{shape, ShapeOptions};
use super::*;
+use crate::shaping;
use crate::style::LayoutStyle;
use crate::syntax::{
Decoration, Expr, NodeHeading, NodeRaw, Span, SpanWith, Spanned, SynNode, SynTree,
@@ -103,12 +103,13 @@ impl<'a> TreeLayouter<'a> {
async fn layout_text(&mut self, text: &str) {
self.layouter.add(
- shape(text, ShapeOptions {
- loader: &mut self.ctx.loader.borrow_mut(),
- style: &self.style.text,
- dir: self.ctx.sys.primary,
- align: self.ctx.align,
- })
+ shaping::shape(
+ text,
+ self.ctx.sys.primary,
+ self.ctx.align,
+ &self.style.text,
+ &mut self.ctx.loader.borrow_mut(),
+ )
.await,
);
}