From 264a7dedd42e27cd9e604037640cf0594b2ec46b Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 19 Mar 2021 17:57:31 +0100 Subject: =?UTF-8?q?Scheduled=20maintenance=20=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/layout/spacing.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/layout/spacing.rs') 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 for Node { - fn from(spacing: NodeSpacing) -> Self { +impl From for Node { + fn from(spacing: SpacingNode) -> Self { Self::Spacing(spacing) } } -- cgit v1.2.3