This commit is contained in:
2025-11-11 13:55:36 -05:00
parent 92db1264a6
commit deaf730901
9 changed files with 87 additions and 3 deletions

View File

@@ -38,7 +38,8 @@ pub struct Padding {
}
impl Padding {
pub fn uniform(amt: f32) -> Self {
pub fn uniform(amt: impl UiNum) -> Self {
let amt = amt.to_f32();
Self {
left: amt,
right: amt,
@@ -54,6 +55,24 @@ impl Padding {
region.bot_right.abs.y -= self.bottom;
region
}
pub fn x(amt: impl UiNum) -> Self {
let amt = amt.to_f32();
Self {
left: amt,
right: amt,
top: 0.0,
bottom: 0.0,
}
}
pub fn y(amt: impl UiNum) -> Self {
let amt = amt.to_f32();
Self {
left: 0.0,
right: 0.0,
top: amt,
bottom: amt,
}
}
}
impl<T: UiNum> From<T> for Padding {