#[repr(C)]pub struct StyleClipRect {
pub top: OptionF32,
pub right: OptionF32,
pub bottom: OptionF32,
pub left: OptionF32,
}Expand description
Represents the deprecated CSS clip property value rect(top, right, bottom, left).
Each edge can be a length or auto. When auto, the edge matches the
element’s generated border box edge:
autofor top/left = 0autofor bottom = used height + vertical padding + vertical borderautofor right = used width + horizontal padding + horizontal border
Negative lengths are permitted.
Fields§
§top: OptionF32Top edge offset in pixels. None means auto (= 0).
right: OptionF32Right edge offset in pixels. None means auto (= used width + horiz padding + horiz border).
bottom: OptionF32Bottom edge offset in pixels. None means auto (= used height + vert padding + vert border).
left: OptionF32Left edge offset in pixels. None means auto (= 0).
Implementations§
Source§impl StyleClipRect
impl StyleClipRect
Sourcepub fn resolve(
&self,
used_width: f32,
used_height: f32,
padding_left: f32,
padding_right: f32,
padding_top: f32,
padding_bottom: f32,
border_left: f32,
border_right: f32,
border_top: f32,
border_bottom: f32,
) -> (f32, f32, f32, f32)
pub fn resolve( &self, used_width: f32, used_height: f32, padding_left: f32, padding_right: f32, padding_top: f32, padding_bottom: f32, border_left: f32, border_right: f32, border_top: f32, border_bottom: f32, ) -> (f32, f32, f32, f32)
Resolves auto values to border box edges given the element’s
used width/height and padding/border sizes.
Returns (top, right, bottom, left) in pixels.
Trait Implementations§
Source§impl Clone for StyleClipRect
impl Clone for StyleClipRect
Source§fn clone(&self) -> StyleClipRect
fn clone(&self) -> StyleClipRect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StyleClipRect
impl Debug for StyleClipRect
Source§impl Default for StyleClipRect
impl Default for StyleClipRect
Source§fn default() -> StyleClipRect
fn default() -> StyleClipRect
Returns the “default value” for a type. Read more
Source§impl FormatAsRustCode for StyleClipRect
impl FormatAsRustCode for StyleClipRect
fn format_as_rust_code(&self, _tabs: usize) -> String
Source§impl From<StyleClipRect> for CssProperty
impl From<StyleClipRect> for CssProperty
Source§fn from(e: StyleClipRect) -> Self
fn from(e: StyleClipRect) -> Self
Converts to this type from the input type.
Source§impl Hash for StyleClipRect
impl Hash for StyleClipRect
Source§impl Ord for StyleClipRect
impl Ord for StyleClipRect
Source§fn cmp(&self, other: &StyleClipRect) -> Ordering
fn cmp(&self, other: &StyleClipRect) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StyleClipRect
impl PartialEq for StyleClipRect
Source§fn eq(&self, other: &StyleClipRect) -> bool
fn eq(&self, other: &StyleClipRect) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for StyleClipRect
impl PartialOrd for StyleClipRect
Source§impl PrintAsCssValue for StyleClipRect
impl PrintAsCssValue for StyleClipRect
fn print_as_css_value(&self) -> String
impl Copy for StyleClipRect
impl Eq for StyleClipRect
impl StructuralPartialEq for StyleClipRect
Auto Trait Implementations§
impl Freeze for StyleClipRect
impl RefUnwindSafe for StyleClipRect
impl Send for StyleClipRect
impl Sync for StyleClipRect
impl Unpin for StyleClipRect
impl UnsafeUnpin for StyleClipRect
impl UnwindSafe for StyleClipRect
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