summaryrefslogtreecommitdiff
path: root/src/layout/spacing.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-19 17:57:31 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-19 17:57:31 +0100
commit264a7dedd42e27cd9e604037640cf0594b2ec46b (patch)
treed26feea399d54bb86bd44878f40293983bf5251d /src/layout/spacing.rs
parentca3df70e2a5069832d7d2135967674c34a155442 (diff)
Scheduled maintenance 🔨
- New naming scheme - TextNode instead of NodeText - CallExpr instead of ExprCall - ... - Less glob imports - Removes Value::Args variant - Removes prelude - Renames Layouted to Fragment - Moves font into env - Moves shaping into layout - Moves frame into separate module
Diffstat (limited to 'src/layout/spacing.rs')
-rw-r--r--src/layout/spacing.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/layout/spacing.rs b/src/layout/spacing.rs
index 2bcb7ac1..361b03ee 100644
--- a/src/layout/spacing.rs
+++ b/src/layout/spacing.rs
@@ -2,9 +2,9 @@ use std::fmt::{self, Debug, Formatter};
use super::*;
-/// A spacing node.
+/// A node that adds spacing to its parent.
#[derive(Copy, Clone, PartialEq)]
-pub struct NodeSpacing {
+pub struct SpacingNode {
/// The amount of spacing to insert.
pub amount: Length,
/// Defines how spacing interacts with surrounding spacing.
@@ -16,20 +16,20 @@ pub struct NodeSpacing {
pub softness: u8,
}
-impl Layout for NodeSpacing {
- fn layout(&self, _: &mut LayoutContext, _: &Areas) -> Layouted {
- Layouted::Spacing(self.amount)
+impl Layout for SpacingNode {
+ fn layout(&self, _: &mut LayoutContext, _: &Areas) -> Fragment {
+ Fragment::Spacing(self.amount)
}
}
-impl Debug for NodeSpacing {
+impl Debug for SpacingNode {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "Spacing({}, {})", self.amount, self.softness)
}
}
-impl From<NodeSpacing> for Node {
- fn from(spacing: NodeSpacing) -> Self {
+impl From<SpacingNode> for Node {
+ fn from(spacing: SpacingNode) -> Self {
Self::Spacing(spacing)
}
}