Make alignment a widget property
This commit is contained in:
1 parent
8220a78d4a
commit
d3b0ebf90c
21 files changed
+823
-300
No files matched your search
@@ -188,6 +188,15 @@ impl UiScalar {
|
||||
}
|
||||
}
|
||||
|
||||
/// Both channels by the same factor, which is what a fraction of a
|
||||
/// length means when the length is part pixels and part a share.
|
||||
pub const fn scale(&self, by: f32) -> Self {
|
||||
Self {
|
||||
rel: self.rel * by,
|
||||
px: self.px * by,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn offset(mut self, amt: f32) -> Self {
|
||||
self.px += amt;
|
||||
self
|
||||
|
||||
Reference in new issue
Block a user