#[derive(Clone, Default, Debug, PartialEq, Eq, Hash)]
pub struct Margin {
top: u16,
left: u16,
right: u16,
bottom: u16,
}
impl Margin {
pub fn from_scratch(top: u16, left: u16, right: u16, bottom: u16) -> Self {
Self {
top,
left,
right,
bottom,
}
}
pub fn from_value(value: u16) -> Self {
Self::from_scratch(value, value, value, value)
}
pub fn top(&self) -> u16 {
self.top
}
pub fn left(&self) -> u16 {
self.left
}
pub fn right(&self) -> u16 {
self.right
}
pub fn bottom(&self) -> u16 {
self.bottom
}
}