1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#[derive(Debug, Clone)] pub struct Margins { pub left: f32, pub right: f32, pub bottom: f32, pub top: f32, } impl Margins { pub fn new(left: f32, right: f32, bottom: f32, top: f32) -> Self { Margins { left, right, bottom, top, } } } impl Default for Margins { fn default() -> Self { Margins { left: 0.0, right: 0.0, bottom: 0.0, top: 0.0, } } }