summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/mod.rs4
-rw-r--r--src/layout/nodes/par.rs14
-rw-r--r--src/layout/nodes/spacing.rs4
-rw-r--r--src/layout/nodes/stack.rs21
4 files changed, 3 insertions, 40 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index f709da1a..bfd633d8 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -7,11 +7,9 @@ pub use primitive::*;
use async_trait::async_trait;
-use crate::eval::{PageState, State, TextState};
use crate::font::SharedFontLoader;
-use crate::geom::{Insets, Point, Rect, Size, SizeExt};
+use crate::geom::{Point, Rect, Size, SizeExt};
use crate::shaping::Shaped;
-use crate::syntax::SynTree;
use nodes::Document;
diff --git a/src/layout/nodes/par.rs b/src/layout/nodes/par.rs
index 38b11529..d0a58c49 100644
--- a/src/layout/nodes/par.rs
+++ b/src/layout/nodes/par.rs
@@ -182,20 +182,6 @@ impl LineLayouter {
usable
}
- /// Update the layouting spaces.
- ///
- /// If `replace_empty` is true, the current space is replaced if there are
- /// no boxes laid out into it yet. Otherwise, the followup spaces are
- /// replaced.
- fn set_spaces(&mut self, spaces: Vec<LayoutSpace>, replace_empty: bool) {
- self.stack.set_spaces(spaces, replace_empty && self.line_is_empty());
- }
-
- /// Update the line spacing.
- fn set_line_spacing(&mut self, line_spacing: f64) {
- self.ctx.line_spacing = line_spacing;
- }
-
/// The remaining inner spaces. If something is laid out into these spaces,
/// it will fit into this layouter's underlying stack.
fn remaining(&self) -> Vec<LayoutSpace> {
diff --git a/src/layout/nodes/spacing.rs b/src/layout/nodes/spacing.rs
index 66af0d17..9d72f7ca 100644
--- a/src/layout/nodes/spacing.rs
+++ b/src/layout/nodes/spacing.rs
@@ -13,8 +13,8 @@ pub struct Spacing {
impl Layout for Spacing {
async fn layout(
&self,
- ctx: &mut LayoutContext,
- constraints: LayoutConstraints,
+ _: &mut LayoutContext,
+ _: LayoutConstraints,
) -> Vec<LayoutItem> {
vec![LayoutItem::Spacing(self.amount)]
}
diff --git a/src/layout/nodes/stack.rs b/src/layout/nodes/stack.rs
index 983175b8..343f4461 100644
--- a/src/layout/nodes/stack.rs
+++ b/src/layout/nodes/stack.rs
@@ -1,5 +1,4 @@
use super::*;
-use crate::geom::Linear;
/// A node that stacks and aligns its children.
///
@@ -158,21 +157,6 @@ impl StackLayouter {
*self.space.usable.get_mut(self.ctx.dirs.main.axis()) -= added.main;
}
- /// Update the layouting spaces.
- ///
- /// If `replace_empty` is true, the current space is replaced if there are
- /// no boxes laid out into it yet. Otherwise, the followup spaces are
- /// replaced.
- pub fn set_spaces(&mut self, spaces: Vec<LayoutSpace>, replace_empty: bool) {
- if replace_empty && self.space_is_empty() {
- self.ctx.spaces = spaces;
- self.start_space(0, self.space.hard);
- } else {
- self.ctx.spaces.truncate(self.space.index + 1);
- self.ctx.spaces.extend(spaces);
- }
- }
-
/// Move to the first space that can fit the given size or do nothing
/// if no space is capable of that.
pub fn skip_to_fitting_space(&mut self, size: Size) {
@@ -208,11 +192,6 @@ impl StackLayouter {
self.space.used == Size::ZERO && self.space.layouts.is_empty()
}
- /// Whether the current layout space is the last in the followup list.
- pub fn space_is_last(&self) -> bool {
- self.space.index == self.ctx.spaces.len() - 1
- }
-
/// Finish everything up and return the final collection of boxes.
pub fn finish(mut self) -> Vec<BoxLayout> {
if self.space.hard || !self.space_is_empty() {