summaryrefslogtreecommitdiff
path: root/src/library/par.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-12-20 14:18:29 +0100
committerLaurenz <laurmaedje@gmail.com>2021-12-21 00:20:24 +0100
commit11565a40b315212474f52eb576a9fd92b11f1132 (patch)
treec6b7afb35103065bc92b407094ca905bb75cfc73 /src/library/par.rs
parent958f74f77707340f34ee36d09492bdb74523aa2a (diff)
Set Rules Episode IX: The Rise of Testing
Diffstat (limited to 'src/library/par.rs')
-rw-r--r--src/library/par.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/library/par.rs b/src/library/par.rs
index 9a70b2c7..5dffd1c0 100644
--- a/src/library/par.rs
+++ b/src/library/par.rs
@@ -74,10 +74,10 @@ impl Set for ParNode {
align = Some(if dir == Dir::LTR { Align::Left } else { Align::Right });
}
- set!(styles, Self::DIR => dir);
- set!(styles, Self::ALIGN => align);
- set!(styles, Self::LEADING => leading);
- set!(styles, Self::SPACING => spacing);
+ styles.set_opt(Self::DIR, dir);
+ styles.set_opt(Self::ALIGN, align);
+ styles.set_opt(Self::LEADING, leading);
+ styles.set_opt(Self::SPACING, spacing);
Ok(())
}
@@ -93,8 +93,7 @@ impl Layout for ParNode {
let text = self.collect_text();
// Find out the BiDi embedding levels.
- let default_level = Level::from_dir(ctx.styles.get(Self::DIR));
- let bidi = BidiInfo::new(&text, default_level);
+ let bidi = BidiInfo::new(&text, Level::from_dir(ctx.styles.get(Self::DIR)));
// Prepare paragraph layout by building a representation on which we can
// do line breaking without layouting each and every line from scratch.