summaryrefslogtreecommitdiff
path: root/src/layout/pad.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/pad.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/pad.rs')
-rw-r--r--src/layout/pad.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/layout/pad.rs b/src/layout/pad.rs
index 88ef8828..33ce217d 100644
--- a/src/layout/pad.rs
+++ b/src/layout/pad.rs
@@ -1,17 +1,16 @@
use super::*;
-use crate::geom::Linear;
/// A node that adds padding to its child.
#[derive(Debug, Clone, PartialEq)]
-pub struct NodePad {
+pub struct PadNode {
/// The amount of padding.
pub padding: Sides<Linear>,
/// The child node whose sides to pad.
pub child: Node,
}
-impl Layout for NodePad {
- fn layout(&self, ctx: &mut LayoutContext, areas: &Areas) -> Layouted {
+impl Layout for PadNode {
+ fn layout(&self, ctx: &mut LayoutContext, areas: &Areas) -> Fragment {
let areas = shrink(areas, self.padding);
let mut layouted = self.child.layout(ctx, &areas);
@@ -23,8 +22,8 @@ impl Layout for NodePad {
}
}
-impl From<NodePad> for NodeAny {
- fn from(pad: NodePad) -> Self {
+impl From<PadNode> for AnyNode {
+ fn from(pad: PadNode) -> Self {
Self::new(pad)
}
}