pub trait ICustomDrawOperation:
Send
+ Sync
+ 'static {
// Required methods
fn bounds(&self) -> Rect;
fn hit_test(&self, p: Point) -> bool;
fn render(&self, context: &mut ImmediateDrawingContext<'_>);
fn equals(&self, other: &dyn ICustomDrawOperation) -> bool;
fn dispose(&self);
// Provided method
fn hit_test_geometry(&self, _geometry: &Ref<Geometry>) -> IntersectionResult { ... }
}Expand description
Represents a custom draw operation in the low-level scene graph.
An operation is created on the UI thread and rendered on the render
thread, so it is Send + Sync: what it draws with is captured by value
or in thread-safe form.
Required Methods§
Sourcefn hit_test(&self, p: Point) -> bool
fn hit_test(&self, p: Point) -> bool
Hit tests the node against a point, in global coordinates.
The implementation is responsible for checking transforms and geometry clips if necessary.
Sourcefn render(&self, context: &mut ImmediateDrawingContext<'_>)
fn render(&self, context: &mut ImmediateDrawingContext<'_>)
Renders the node to a drawing context.
Sourcefn equals(&self, other: &dyn ICustomDrawOperation) -> bool
fn equals(&self, other: &dyn ICustomDrawOperation) -> bool
Value equality between operations (C# IEquatable<ICustomDrawOperation>).
Provided Methods§
Sourcefn hit_test_geometry(&self, _geometry: &Ref<Geometry>) -> IntersectionResult
fn hit_test_geometry(&self, _geometry: &Ref<Geometry>) -> IntersectionResult
Hit tests the node against a geometry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".