pub struct RectElement {
pub style: StyleState,
pub layout: LayoutData,
pub text_style_data: TextStyleData,
pub relative_layer: Layer,
pub event_handlers: EventHandlers,
pub accessibility: AccessibilityData,
pub effect: Option<EffectData>,
}Fields§
§style: StyleState§layout: LayoutData§text_style_data: TextStyleData§relative_layer: Layer§event_handlers: EventHandlers§accessibility: AccessibilityData§effect: Option<EffectData>Implementations§
Source§impl RectElement
impl RectElement
pub fn render_shadow( canvas: &Canvas, path: &mut SkPath, rounded_rect: SkRRect, _area: Area, shadow: &Shadow, corner_radius: &CornerRadius, )
pub fn render_border( canvas: &Canvas, rect: SkRect, border: &Border, corner_radius: &CornerRadius, )
Sourcepub fn border_shape(
base_rect: SkRect,
base_corner_radius: &CornerRadius,
border: &Border,
) -> BorderShape
pub fn border_shape( base_rect: SkRect, base_corner_radius: &CornerRadius, border: &Border, ) -> BorderShape
Returns a Path that will draw a Border around a base rectangle.
We don’t use Skia’s stroking API here, since we might need different widths for each side.
Trait Implementations§
Source§impl Clone for RectElement
impl Clone for RectElement
Source§impl Default for RectElement
impl Default for RectElement
Source§impl ElementExt for RectElement
impl ElementExt for RectElement
Source§fn is_point_inside(&self, context: EventMeasurementContext<'_>) -> bool
fn is_point_inside(&self, context: EventMeasurementContext<'_>) -> bool
Checks if the cursor point is inside the rounded rectangle of this element, using local coordinates relative to the element’s visible area for improved precision with large absolute coordinates.
Source§fn changed(&self, other: &Rc<dyn ElementExt>) -> bool
fn changed(&self, other: &Rc<dyn ElementExt>) -> bool
Returns whether this element has changed compared to another one.
Source§fn diff(&self, other: &Rc<dyn ElementExt>) -> DiffModifies
fn diff(&self, other: &Rc<dyn ElementExt>) -> DiffModifies
Tells Freya what needs updating when this element changes.
Source§fn layout(&self) -> Cow<'_, LayoutData>
fn layout(&self) -> Cow<'_, LayoutData>
Returns layout properties used to position and size this element.
Source§fn effect(&self) -> Option<Cow<'_, EffectData>>
fn effect(&self) -> Option<Cow<'_, EffectData>>
Returns optional effect properties for this element.
Source§fn style(&self) -> Cow<'_, StyleState>
fn style(&self) -> Cow<'_, StyleState>
Returns visual style properties for this element.
Source§fn text_style(&self) -> Cow<'_, TextStyleData>
fn text_style(&self) -> Cow<'_, TextStyleData>
Returns text styling inherited by text content in this element.
Source§fn accessibility(&self) -> Cow<'_, AccessibilityData>
fn accessibility(&self) -> Cow<'_, AccessibilityData>
Returns accessibility properties for this element.
Source§fn events_handlers(&self) -> Option<Cow<'_, EventHandlers>>
fn events_handlers(&self) -> Option<Cow<'_, EventHandlers>>
Returns event handlers registered on this element.
Source§fn clip(&self, context: ClipContext<'_>)
fn clip(&self, context: ClipContext<'_>)
Applies clipping for this element before it and its children are rendered.
Source§fn render(&self, context: RenderContext<'_>)
fn render(&self, context: RenderContext<'_>)
Renders this element using the supplied canvas and layout context.
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Whether the element paints nothing, letting events fall through to
non-ancestor elements behind it.
Source§fn measure(&self, _context: LayoutContext<'_>) -> Option<(Size2D, Rc<dyn Any>)>
fn measure(&self, _context: LayoutContext<'_>) -> Option<(Size2D, Rc<dyn Any>)>
Measures the element and optionally returns measurement data for later layout stages.
Source§fn should_hook_measurement(&self) -> bool
fn should_hook_measurement(&self) -> bool
Returns whether this element hooks into layout measurement.
Source§fn should_measure_inner_children(&self) -> bool
fn should_measure_inner_children(&self) -> bool
Returns whether to measure this element’s children.
Source§fn needs_post_measure(&self) -> bool
fn needs_post_measure(&self) -> bool
Whether this element needs a ElementExt::post_measure step after the layout pass.
Source§fn post_measure(&self, _context: PostMeasureContext<'_>) -> PostMeasure<NodeId>
fn post_measure(&self, _context: PostMeasureContext<'_>) -> PostMeasure<NodeId>
Runs after this element and its children are measured.
Source§fn render_rect(&self, area: &Area, scale_factor: f32) -> SkRRect
fn render_rect(&self, area: &Area, scale_factor: f32) -> SkRRect
Creates a rounded rectangle from an area using this element’s corner radius.
Source§fn finish_accessibility(&self, _builder: &mut Node)
fn finish_accessibility(&self, _builder: &mut Node)
Mutates the accessibility node immediately before it enters the accessibility tree.
Source§impl PartialEq for RectElement
impl PartialEq for RectElement
impl StructuralPartialEq for RectElement
Auto Trait Implementations§
impl !RefUnwindSafe for RectElement
impl !Send for RectElement
impl !Sync for RectElement
impl !UnwindSafe for RectElement
impl Freeze for RectElement
impl Unpin for RectElement
impl UnsafeUnpin for RectElement
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more