pub struct ComponentPosition {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}Expand description
Position and dimensions for a component within the dashboard grid
Fields§
§x: f64X coordinate in points
y: f64Y coordinate in points
width: f64Width in points
height: f64Height in points
Implementations§
Source§impl ComponentPosition
impl ComponentPosition
Sourcepub fn bottom_right(&self) -> Point
pub fn bottom_right(&self) -> Point
Get the bottom-right corner
Sourcepub fn with_padding(&self, padding: f64) -> Self
pub fn with_padding(&self, padding: f64) -> Self
Create a position with padding applied
Sourcepub fn aspect_ratio(&self) -> f64
pub fn aspect_ratio(&self) -> f64
Get aspect ratio (width/height)
Trait Implementations§
Source§impl Clone for ComponentPosition
impl Clone for ComponentPosition
Source§fn clone(&self) -> ComponentPosition
fn clone(&self) -> ComponentPosition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentPosition
impl Debug for ComponentPosition
impl Copy for ComponentPosition
Auto Trait Implementations§
impl Freeze for ComponentPosition
impl RefUnwindSafe for ComponentPosition
impl Send for ComponentPosition
impl Sync for ComponentPosition
impl Unpin for ComponentPosition
impl UnwindSafe for ComponentPosition
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