pub struct BoxDimensions {
pub content: Size<f32>,
pub padding: Rect<f32>,
pub border: Rect<f32>,
pub margin: Rect<f32>,
}Expand description
The four geometric regions of a box in the layout model: content box, padding box, border box, and margin box.
Fields§
§content: Size<f32>Inner content dimensions in logical pixels.
padding: Rect<f32>Padding insets in logical pixels (>= 0.0).
border: Rect<f32>Border insets in logical pixels (>= 0.0).
margin: Rect<f32>Margin insets in logical pixels (can be negative).
Implementations§
Source§impl BoxDimensions
impl BoxDimensions
Sourcepub fn content_box(&self) -> Size<f32>
pub fn content_box(&self) -> Size<f32>
Returns the inner content size.
Sourcepub fn padding_box(&self) -> Size<f32>
pub fn padding_box(&self) -> Size<f32>
Returns the size including content and padding.
Sourcepub fn border_box(&self) -> Size<f32>
pub fn border_box(&self) -> Size<f32>
Returns the outer size including content, padding, and border. In Native GUI native layout, border-box represents the widget’s allocated rectangle.
Sourcepub fn margin_box(&self) -> Size<f32>
pub fn margin_box(&self) -> Size<f32>
Returns the outer margin-box size including content, padding, border, and margin. Note that margins can be negative, which contracts the margin box.
Trait Implementations§
Source§impl Clone for BoxDimensions
impl Clone for BoxDimensions
impl Copy for BoxDimensions
Source§impl Debug for BoxDimensions
impl Debug for BoxDimensions
Source§impl Default for BoxDimensions
impl Default for BoxDimensions
Source§impl PartialEq for BoxDimensions
impl PartialEq for BoxDimensions
impl StructuralPartialEq for BoxDimensions
Auto Trait Implementations§
impl Forget for BoxDimensions
impl Freeze for BoxDimensions
impl Move for BoxDimensions
impl RefUnwindSafe for BoxDimensions
impl Send for BoxDimensions
impl Sync for BoxDimensions
impl Unpin for BoxDimensions
impl UnsafeUnpin for BoxDimensions
impl UnwindSafe for BoxDimensions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more