pub struct RoundedRectKeypoints {
pub left_top: Point,
pub top_left: Point,
pub top_right: Point,
pub right_top: Point,
pub right_bottom: Point,
pub bottom_right: Point,
pub bottom_left: Point,
pub left_bottom: Point,
}Expand description
Represents the keypoints of a rounded rectangle. These keypoints can be shared between methods and turned into geometry.
A rounded rectangle is the base geometric shape used when drawing borders. It is a superset of a simple rectangle (which has corner radii set to zero). These keypoints can be combined together to produce geometries for both background and border elements.
Fields§
§left_top: PointThe topmost point in the left line segment of the rectangle.
top_left: PointThe leftmost point in the top line segment of the rectangle.
top_right: PointThe rightmost point in the top line segment of the rectangle.
right_top: PointThe topmost point in the right line segment of the rectangle.
right_bottom: PointThe bottommost point in the right line segment of the rectangle.
bottom_right: PointThe rightmost point in the bottom line segment of the rectangle.
bottom_left: PointThe leftmost point in the bottom line segment of the rectangle.
left_bottom: PointThe bottommost point in the left line segment of the rectangle.
Implementations§
Source§impl RoundedRectKeypoints
impl RoundedRectKeypoints
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes a new instance of the RoundedRectKeypoints struct.
Sourcepub fn from_rounded_rect(rounded_rect: RoundedRect) -> Self
pub fn from_rounded_rect(rounded_rect: RoundedRect) -> Self
Initializes a new instance of the RoundedRectKeypoints struct.
rounded_rect- An existingRoundedRectto initialize keypoints with.
Sourcepub fn is_rounded(&self) -> bool
pub fn is_rounded(&self) -> bool
Gets a value indicating whether the rounded rectangle is actually rounded on any corner. If false the key points represent a simple rectangle.
Sourcepub fn to_rect(&self) -> Rect
pub fn to_rect(&self) -> Rect
Converts the keypoints into a simple rectangle (with no corners). This is equivalent to the outer rectangle with zero corner radii.
Warning: This will force the keypoints into a simple rectangle without
any rounded corners. Use is_rounded to determine if corner
information is otherwise available.
Sourcepub fn to_rounded_rect(&self) -> RoundedRect
pub fn to_rounded_rect(&self) -> RoundedRect
Converts the keypoints into a rounded rectangle with elliptical corner radii.
Elliptical corner radius (represented by Vector) is more powerful
than circular corner radius (represented by a CornerRadius).
Elliptical is a superset of circular.
Trait Implementations§
Source§impl Clone for RoundedRectKeypoints
impl Clone for RoundedRectKeypoints
impl Copy for RoundedRectKeypoints
Source§impl Debug for RoundedRectKeypoints
impl Debug for RoundedRectKeypoints
Source§impl Default for RoundedRectKeypoints
impl Default for RoundedRectKeypoints
Source§impl PartialEq for RoundedRectKeypoints
impl PartialEq for RoundedRectKeypoints
impl StructuralPartialEq for RoundedRectKeypoints
Auto Trait Implementations§
impl Freeze for RoundedRectKeypoints
impl RefUnwindSafe for RoundedRectKeypoints
impl Send for RoundedRectKeypoints
impl Sync for RoundedRectKeypoints
impl Unpin for RoundedRectKeypoints
impl UnsafeUnpin for RoundedRectKeypoints
impl UnwindSafe for RoundedRectKeypoints
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more