summaryrefslogtreecommitdiff
path: root/src/style
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-17 17:09:19 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-17 17:09:19 +0100
commit89f2e71852e96062ea9b756bf92fbf4e894871b1 (patch)
tree836099ebd17adf30a24fc62464dfdd3d9c248480 /src/style
parent9a800daa82833c57eee04e92c701ca9a05a67d3b (diff)
Align node
Diffstat (limited to 'src/style')
-rw-r--r--src/style/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/style/mod.rs b/src/style/mod.rs
index c2a92568..9cf2de07 100644
--- a/src/style/mod.rs
+++ b/src/style/mod.rs
@@ -16,8 +16,6 @@ use crate::util::EcoString;
/// Defines a set of properties a template can be instantiated with.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct Style {
- /// The alignments of layouts in their parents.
- pub aligns: Gen<Align>,
/// The page settings.
pub page: Rc<PageStyle>,
/// The paragraph settings.
@@ -56,7 +54,6 @@ impl Style {
impl Default for Style {
fn default() -> Self {
Self {
- aligns: Gen::splat(Align::Start),
page: Rc::new(PageStyle::default()),
par: Rc::new(ParStyle::default()),
text: Rc::new(TextStyle::default()),
@@ -103,8 +100,10 @@ impl Default for PageStyle {
/// Defines style properties of paragraphs.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct ParStyle {
- /// The direction for text and other inline objects.
+ /// The direction for text and inline objects.
pub dir: Dir,
+ /// How to align text and inline objects in their line.
+ pub align: Align,
/// The spacing between lines (dependent on scaled font size).
pub leading: Linear,
/// The spacing between paragraphs (dependent on scaled font size).
@@ -115,6 +114,7 @@ impl Default for ParStyle {
fn default() -> Self {
Self {
dir: Dir::LTR,
+ align: Align::Left,
leading: Relative::new(0.65).into(),
spacing: Relative::new(1.2).into(),
}