diff --git a/src/layout.rs b/src/layout.rs index f25fa45584..dc4c9aaa4f 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -120,6 +120,7 @@ pub enum Align { Right, Center, Justified, + End, } impl Display for Align { @@ -129,6 +130,7 @@ impl Display for Align { Self::Right => write!(f, "Right"), Self::Center => write!(f, "Center"), Self::Justified => write!(f, "Justified"), + Self::End => write!(f, "End"), } } } diff --git a/src/shape.rs b/src/shape.rs index cf1c413b1e..d606da4661 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -1001,6 +1001,7 @@ impl ShapeLine { (Align::Right, true) => 0., (Align::Right, false) => line_width - visual_line.w, (Align::Center, _) => (line_width - visual_line.w) / 2.0, + (Align::End, _) => line_width - visual_line.w, (Align::Justified, _) => { // Don't justify the last line in a paragraph. if visual_line.spaces > 0 && index != number_of_visual_lines - 1 {