Add more Float functions
This commit is contained in:
parent
7c3277a822
commit
8834bb6d9d
1 changed files with 28 additions and 0 deletions
|
|
@ -31,6 +31,34 @@ impl<I> Float<I> {
|
||||||
self.horizontal(position).vertical(position)
|
self.horizontal(position).vertical(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn left(self) -> Self {
|
||||||
|
self.horizontal(0.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn right(self) -> Self {
|
||||||
|
self.horizontal(1.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn top(self) -> Self {
|
||||||
|
self.vertical(0.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn bottom(self) -> Self {
|
||||||
|
self.vertical(1.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn center_h(self) -> Self {
|
||||||
|
self.horizontal(0.5)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn center_v(self) -> Self {
|
||||||
|
self.vertical(0.5)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn center(self) -> Self {
|
||||||
|
self.all(0.5)
|
||||||
|
}
|
||||||
|
|
||||||
fn push_inner(&self, frame: &mut Frame, size: Size, mut inner_size: Size) {
|
fn push_inner(&self, frame: &mut Frame, size: Size, mut inner_size: Size) {
|
||||||
let mut inner_pos = Pos::ZERO;
|
let mut inner_pos = Pos::ZERO;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue