RoundedRectKeypoints
struct · ferroui-base · v0.5.0
struct RoundedRectKeypoints
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.
Members
left_toptop_lefttop_rightright_topright_bottombottom_rightbottom_leftleft_bottomnewfrom_rounded_rectis_roundedto_rectto_rounded_rect
left_top
left_top: crate::Point
The topmost point in the left line segment of the rectangle.
top_left
top_left: crate::Point
The leftmost point in the top line segment of the rectangle.
top_right
top_right: crate::Point
The rightmost point in the top line segment of the rectangle.
right_top
right_top: crate::Point
The topmost point in the right line segment of the rectangle.
right_bottom
right_bottom: crate::Point
The bottommost point in the right line segment of the rectangle.
bottom_right
bottom_right: crate::Point
The rightmost point in the bottom line segment of the rectangle.
bottom_left
bottom_left: crate::Point
The leftmost point in the bottom line segment of the rectangle.
left_bottom
left_bottom: crate::Point
The bottommost point in the left line segment of the rectangle.
new
fn new() -> Self
Initializes a new instance of the RoundedRectKeypoints struct.
from_rounded_rect
fn from_rounded_rect(rounded_rect: RoundedRect) -> Self
Initializes a new instance of the RoundedRectKeypoints struct.
rounded_rect- An existingRoundedRectto initialize keypoints with.
is_rounded
fn is_rounded(self: &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.
to_rect
fn to_rect(self: &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.
to_rounded_rect
fn to_rounded_rect(self: &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
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyDebugStructuralPartialEqPartialEqDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.