summaryrefslogtreecommitdiff
path: root/src/layout/line.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-02-03 12:22:02 +0100
committerLaurenz <laurmaedje@gmail.com>2020-02-03 12:22:02 +0100
commit3150fd56437ecf8b2a5902c18e3f9ace800b768c (patch)
treedb8a7e9fc868145804db97da81bd0669aaf55454 /src/layout/line.rs
parent40ea35cbe7482ce04096c4d63a848c8601cc1848 (diff)
Better Debug/Display and Derives 🧽
Diffstat (limited to 'src/layout/line.rs')
-rw-r--r--src/layout/line.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/layout/line.rs b/src/layout/line.rs
index 2c8e45f2..18ace29f 100644
--- a/src/layout/line.rs
+++ b/src/layout/line.rs
@@ -13,7 +13,7 @@ use super::*;
/// Performs the line layouting.
-#[derive(Debug, Clone)]
+#[derive(Debug)]
pub struct LineLayouter {
/// The context for layouting.
ctx: LineContext,
@@ -46,7 +46,7 @@ pub struct LineContext {
/// A line run is a sequence of boxes with the same alignment that are arranged
/// in a line. A real line can consist of multiple runs with different
/// alignments.
-#[derive(Debug, Clone)]
+#[derive(Debug)]
struct LineRun {
/// The so-far accumulated layouts in the line.
layouts: Vec<(Size, Layout)>,
@@ -102,7 +102,7 @@ impl LineLayouter {
} else if layout.alignment.primary > alignment.primary {
let mut rest_run = LineRun::new();
- let usable = self.stack.usable().get_primary(axes);
+ let usable = self.stack.usable().primary(axes);
rest_run.usable = Some(match layout.alignment.primary {
Alignment::Origin => unreachable!("origin > x"),
Alignment::Center => usable - 2 * self.run.size.x,
@@ -228,7 +228,7 @@ impl LineLayouter {
/// a function how much space it has to layout itself.
pub fn remaining(&self) -> LayoutSpaces {
let mut spaces = self.stack.remaining();
- *spaces[0].dimensions.get_secondary_mut(self.ctx.axes)
+ *spaces[0].dimensions.secondary_mut(self.ctx.axes)
-= self.run.size.y;
spaces
}
@@ -262,7 +262,7 @@ impl LineLayouter {
true => offset,
false => self.run.size.x
- offset
- - layout.dimensions.get_primary(self.ctx.axes),
+ - layout.dimensions.primary(self.ctx.axes),
};
let pos = Size2D::with_x(x);