diff options
-rw-r--r-- | core/src/types.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/src/types.rs b/core/src/types.rs index 96e059a..b3df84f 100644 --- a/core/src/types.rs +++ b/core/src/types.rs | |||
@@ -141,6 +141,10 @@ impl Bounds { | |||
141 | Point2D::new(self.right(solver), self.top) | 141 | Point2D::new(self.right(solver), self.top) |
142 | } | 142 | } |
143 | 143 | ||
144 | pub fn top_middle(&self, solver: &mut dyn SolverContext) -> Point2D { | ||
145 | Point2D::new(self.horiz_center(solver), self.top) | ||
146 | } | ||
147 | |||
144 | pub fn bottom_left(&self, solver: &mut dyn SolverContext) -> Point2D { | 148 | pub fn bottom_left(&self, solver: &mut dyn SolverContext) -> Point2D { |
145 | Point2D::new(self.left, self.bottom(solver)) | 149 | Point2D::new(self.left, self.bottom(solver)) |
146 | } | 150 | } |
@@ -149,6 +153,18 @@ impl Bounds { | |||
149 | Point2D::new(self.right(solver), self.bottom(solver)) | 153 | Point2D::new(self.right(solver), self.bottom(solver)) |
150 | } | 154 | } |
151 | 155 | ||
156 | pub fn bottom_middle(&self, solver: &mut dyn SolverContext) -> Point2D { | ||
157 | Point2D::new(self.horiz_center(solver), self.bottom(solver)) | ||
158 | } | ||
159 | |||
160 | pub fn middle_left(&self, solver: &mut dyn SolverContext) -> Point2D { | ||
161 | Point2D::new(self.left, self.vert_center(solver)) | ||
162 | } | ||
163 | |||
164 | pub fn middle_right(&self, solver: &mut dyn SolverContext) -> Point2D { | ||
165 | Point2D::new(self.right(solver), self.vert_center(solver)) | ||
166 | } | ||
167 | |||
152 | pub fn center(&self, solver: &mut dyn SolverContext) -> Point2D { | 168 | pub fn center(&self, solver: &mut dyn SolverContext) -> Point2D { |
153 | Point2D::new(self.horiz_center(solver), self.vert_center(solver)) | 169 | Point2D::new(self.horiz_center(solver), self.vert_center(solver)) |
154 | } | 170 | } |