pub struct GeometryBuilder;Expand description
Contains internal helpers used to build and draw various geometries.
Implementations§
Source§impl GeometryBuilder
impl GeometryBuilder
Sourcepub fn draw_rounded_corners_rectangle_keypoints(
context: &mut StreamGeometryContext,
keypoints: &RoundedRectKeypoints,
)
pub fn draw_rounded_corners_rectangle_keypoints( context: &mut StreamGeometryContext, keypoints: &RoundedRectKeypoints, )
Draws a new rounded rectangle within the given geometry context.
Warning: The caller must manage and dispose the StreamGeometryContext externally.
WinUI: https://github.com/microsoft/microsoft-ui-xaml/blob/93742a178db8f625ba9299f62c21f656e0b195ad/dxaml/xcp/core/core/elements/geometry.cpp#L1072-L1079
context- The geometry context to draw into.keypoints- The rounded rectangle keypoints defining the rectangle to draw.
Sourcepub fn draw_rounded_corners_rectangle(
context: &mut dyn IGeometryContext,
rect: Rect,
radius_x: f64,
radius_y: f64,
)
pub fn draw_rounded_corners_rectangle( context: &mut dyn IGeometryContext, rect: Rect, radius_x: f64, radius_y: f64, )
Draws a new rounded rectangle within the given geometry context.
Warning: The caller must manage and dispose the StreamGeometryContext externally.
context- The geometry context to draw into.rect- The existing rectangle dimensions without corner radii.radius_x- The radius on the X-axis used to round the corners of the rectangle.radius_y- The radius on the Y-axis used to round the corners of the rectangle.
Sourcepub fn calculate_rounded_corners_rectangle_win_ui(
outer_bounds: Rect,
border_thickness: Thickness,
corner_radius: CornerRadius,
sizing: BackgroundSizing,
) -> RoundedRectKeypoints
pub fn calculate_rounded_corners_rectangle_win_ui( outer_bounds: Rect, border_thickness: Thickness, corner_radius: CornerRadius, sizing: BackgroundSizing, ) -> RoundedRectKeypoints
Calculates the keypoints of a rounded rectangle based on the algorithm in WinUI. These keypoints may then be drawn or transformed into other types.
outer_bounds- The outer bounds of the rounded rectangle. This should be the overall bounds and size of the shape/control without any corner radii or border thickness adjustments.border_thickness- The unadjusted border thickness of the rounded rectangle.corner_radius- The unadjusted corner radii of the rounded rectangle. The corner radius is defined to be the middle of the border stroke (center of the border).sizing- The sizing mode used to calculate the final rounded rectangle size.
Returns new rounded rectangle keypoints.
Auto Trait Implementations§
impl Freeze for GeometryBuilder
impl RefUnwindSafe for GeometryBuilder
impl Send for GeometryBuilder
impl Sync for GeometryBuilder
impl Unpin for GeometryBuilder
impl UnsafeUnpin for GeometryBuilder
impl UnwindSafe for GeometryBuilder
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more