summaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index e31d2c17..afdab1ef 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -26,7 +26,7 @@ pub mod layouters {
pub use super::text::{layout_text, TextContext};
}
-pub use actions::{LayoutAction, LayoutActionList};
+pub use actions::{LayoutAction, LayoutActions};
pub use layouters::*;
/// A collection of layouts.
@@ -75,7 +75,7 @@ pub struct LayoutSpace {
pub padding: SizeBox,
/// Whether to expand the dimensions of the resulting layout to the full
/// dimensions of this space or to shrink them to fit the content for the
- /// vertical and horizontal axis.
+ /// horizontal and vertical axis.
pub expand: (bool, bool),
}
@@ -324,17 +324,6 @@ impl Alignment {
}
}
-/// The specialized anchor position for an item with the given alignment in a
-/// container with a given size along the given axis.
-pub fn anchor(axis: Axis, size: Size, alignment: Alignment) -> Size {
- use Alignment::*;
- match (axis.is_positive(), alignment) {
- (true, Origin) | (false, End) => Size::zero(),
- (_, Center) => size / 2,
- (true, End) | (false, Origin) => size,
- }
-}
-
/// Whitespace between boxes with different interaction properties.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum SpacingKind {
@@ -368,6 +357,18 @@ impl LastSpacing {
}
}
+/// The specialized anchor position for an item with the given alignment in a
+/// container with a given size along the given axis.
+#[allow(dead_code)]
+fn anchor(axis: Axis, size: Size, alignment: Alignment) -> Size {
+ use Alignment::*;
+ match (axis.is_positive(), alignment) {
+ (true, Origin) | (false, End) => Size::zero(),
+ (_, Center) => size / 2,
+ (true, End) | (false, Origin) => size,
+ }
+}
+
/// Layout components that can be serialized.
pub trait Serialize {
/// Serialize the data structure into an output writable.