summaryrefslogtreecommitdiff
path: root/src/geom
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-03 00:12:09 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-03 00:12:09 +0100
commitaae67bd572ad86f4c57e364daa51a9dc883b8913 (patch)
tree0aba021e0748ebad2197ea390385ec5f93ccbc6e /src/geom
parent1c40dc42e7bc7b799b77f06d25414aca59a044ba (diff)
Move and rename many things 🚛
Diffstat (limited to 'src/geom')
-rw-r--r--src/geom/align.rs4
-rw-r--r--src/geom/dir.rs4
-rw-r--r--src/geom/gen.rs10
-rw-r--r--src/geom/mod.rs2
-rw-r--r--src/geom/point.rs4
-rw-r--r--src/geom/size.rs4
-rw-r--r--src/geom/spec.rs10
7 files changed, 19 insertions, 19 deletions
diff --git a/src/geom/align.rs b/src/geom/align.rs
index 7c4d965f..8f02a4ea 100644
--- a/src/geom/align.rs
+++ b/src/geom/align.rs
@@ -1,7 +1,7 @@
use super::*;
-/// The alignment of a box in a container.
-pub type BoxAlign = Gen<Align>;
+/// The alignment of a child in a container.
+pub type ChildAlign = Gen<Align>;
/// Where to align something along a directed axis.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
diff --git a/src/geom/dir.rs b/src/geom/dir.rs
index f7ffa3e2..c5eaa3a6 100644
--- a/src/geom/dir.rs
+++ b/src/geom/dir.rs
@@ -1,7 +1,7 @@
use super::*;
-/// The directions along which content flows in a container.
-pub type Flow = Gen<Dir>;
+/// The directions along which nodes are layouted.
+pub type LayoutDirs = Gen<Dir>;
/// The four directions into which content can be laid out.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
diff --git a/src/geom/gen.rs b/src/geom/gen.rs
index 11b117ea..8723ea99 100644
--- a/src/geom/gen.rs
+++ b/src/geom/gen.rs
@@ -50,8 +50,8 @@ impl<T> Get<GenAxis> for Gen<T> {
impl<T> Switch for Gen<T> {
type Other = Spec<T>;
- fn switch(self, flow: Flow) -> Self::Other {
- match flow.main.axis() {
+ fn switch(self, dirs: LayoutDirs) -> Self::Other {
+ match dirs.main.axis() {
SpecAxis::Horizontal => Spec::new(self.main, self.cross),
SpecAxis::Vertical => Spec::new(self.cross, self.main),
}
@@ -80,10 +80,10 @@ impl GenAxis {
impl Switch for GenAxis {
type Other = SpecAxis;
- fn switch(self, flow: Flow) -> Self::Other {
+ fn switch(self, dirs: LayoutDirs) -> Self::Other {
match self {
- Self::Main => flow.main.axis(),
- Self::Cross => flow.cross.axis(),
+ Self::Main => dirs.main.axis(),
+ Self::Cross => dirs.cross.axis(),
}
}
}
diff --git a/src/geom/mod.rs b/src/geom/mod.rs
index 0589346e..69bb0898 100644
--- a/src/geom/mod.rs
+++ b/src/geom/mod.rs
@@ -50,5 +50,5 @@ pub trait Switch {
/// The other version of this type based on the current layouting
/// directions.
- fn switch(self, flow: Flow) -> Self::Other;
+ fn switch(self, dirs: LayoutDirs) -> Self::Other;
}
diff --git a/src/geom/point.rs b/src/geom/point.rs
index 4523a861..0faa781c 100644
--- a/src/geom/point.rs
+++ b/src/geom/point.rs
@@ -45,8 +45,8 @@ impl Get<SpecAxis> for Point {
impl Switch for Point {
type Other = Gen<Length>;
- fn switch(self, flow: Flow) -> Self::Other {
- match flow.main.axis() {
+ fn switch(self, dirs: LayoutDirs) -> Self::Other {
+ match dirs.main.axis() {
SpecAxis::Horizontal => Gen::new(self.x, self.y),
SpecAxis::Vertical => Gen::new(self.y, self.x),
}
diff --git a/src/geom/size.rs b/src/geom/size.rs
index 28984659..bc233e5c 100644
--- a/src/geom/size.rs
+++ b/src/geom/size.rs
@@ -53,8 +53,8 @@ impl Get<SpecAxis> for Size {
impl Switch for Size {
type Other = Gen<Length>;
- fn switch(self, flow: Flow) -> Self::Other {
- match flow.main.axis() {
+ fn switch(self, dirs: LayoutDirs) -> Self::Other {
+ match dirs.main.axis() {
SpecAxis::Horizontal => Gen::new(self.width, self.height),
SpecAxis::Vertical => Gen::new(self.height, self.width),
}
diff --git a/src/geom/spec.rs b/src/geom/spec.rs
index f259ce25..c61f9526 100644
--- a/src/geom/spec.rs
+++ b/src/geom/spec.rs
@@ -66,8 +66,8 @@ impl<T> Get<SpecAxis> for Spec<T> {
impl<T> Switch for Spec<T> {
type Other = Gen<T>;
- fn switch(self, flow: Flow) -> Self::Other {
- match flow.main.axis() {
+ fn switch(self, dirs: LayoutDirs) -> Self::Other {
+ match dirs.main.axis() {
SpecAxis::Horizontal => Gen::new(self.horizontal, self.vertical),
SpecAxis::Vertical => Gen::new(self.vertical, self.horizontal),
}
@@ -96,11 +96,11 @@ impl SpecAxis {
impl Switch for SpecAxis {
type Other = GenAxis;
- fn switch(self, flow: Flow) -> Self::Other {
- if self == flow.main.axis() {
+ fn switch(self, dirs: LayoutDirs) -> Self::Other {
+ if self == dirs.main.axis() {
GenAxis::Main
} else {
- debug_assert_eq!(self, flow.cross.axis());
+ debug_assert_eq!(self, dirs.cross.axis());
GenAxis::Cross
}
}