diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-11 22:38:30 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-11 22:38:30 +0200 |
| commit | d3bc4ec07349a96c3863ddce63c2e52b5e7e9f2f (patch) | |
| tree | 09c582973b58f05f9248d88f0020bf1dda262aa5 /src/layout/spacing.rs | |
| parent | f04ad0ffa5f34bb7fd97e5c94c7547f96904220c (diff) | |
Refactor layouting base 🪁
Diffstat (limited to 'src/layout/spacing.rs')
| -rw-r--r-- | src/layout/spacing.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/layout/spacing.rs b/src/layout/spacing.rs index 766ff4d2..427cb7b0 100644 --- a/src/layout/spacing.rs +++ b/src/layout/spacing.rs @@ -2,16 +2,21 @@ use std::fmt::{self, Debug, Formatter}; use super::*; -/// A node that inserts spacing. +/// A spacing node. #[derive(Copy, Clone, PartialEq)] pub struct Spacing { + /// The amount of spacing to insert. pub amount: Length, + /// Spacing interaction, see [Softness's] documentation for more + /// information. + /// + /// [Softness's]: enum.Softness.html pub softness: Softness, } #[async_trait(?Send)] impl Layout for Spacing { - async fn layout(&self, _: &mut LayoutContext, _: LayoutConstraints) -> Vec<Layouted> { + async fn layout(&self, _: &mut LayoutContext, _: &Areas) -> Vec<Layouted> { vec![Layouted::Spacing(self.amount)] } } |
