pub struct Path {
pub fill_type: FillRule,
/* private fields */
}Expand description
A complex, one-dimensional subset of a plane: dart:ui’s Path.
Its contours are a valo path, built with a PathBuilder and shared, not copied, by every
clone; its fill_type is what valo is handed with them wherever the path
is filled, clipped to or hit tested. A call that passes as_valo to valo
without the fill type fills the path with whatever rule it names instead.
Two paths are equal when their contours and fill types are, which is how a scene tells a clip that changed from one that did not.
Fields§
§fill_type: FillRuleDetermines how the interior of this path is calculated.
Defaults to the non-zero winding rule, PathFillType::NonZero.
Implementations§
Source§impl Path
impl Path
Sourcepub fn new(contours: Arc<Path>) -> Path
pub fn new(contours: Arc<Path>) -> Path
The path of contours, filled with the non-zero winding rule, as dart:ui’s Path() is.
Sourcepub fn as_valo(&self) -> &Arc<Path> ⓘ
pub fn as_valo(&self) -> &Arc<Path> ⓘ
The contours, for valo’s calls, which take the fill type beside them.
Sourcepub fn contains(&self, point: Offset) -> bool
pub fn contains(&self, point: Offset) -> bool
Tests to see if the given point is within the path. (That is, whether the point would be
in the visible portion of the path if the path was used with Canvas::clip_path.)
The point argument is interpreted as an offset from the origin.
Returns true if the point is in the path, and false otherwise.
Sourcepub fn get_bounds(&self) -> Rect
pub fn get_bounds(&self) -> Rect
Computes the bounding rectangle for this path.
A path containing only axis-aligned points on the same straight line will have no area,
and therefore Rect::is_empty will return true for such a path.
Trait Implementations§
Source§impl CustomClipper<Path> for ShapeBorderClipper
impl CustomClipper<Path> for ShapeBorderClipper
Source§fn get_clip(&self, _app: &App, size: Size) -> Path
fn get_clip(&self, _app: &App, size: Size) -> Path
Source§fn should_reclip(
&self,
_app: &App,
old_clipper: &(dyn CustomClipper<Path> + 'static),
) -> bool
fn should_reclip( &self, _app: &App, old_clipper: &(dyn CustomClipper<Path> + 'static), ) -> bool
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
runtimeType comparison and covariant parameter.Source§fn reclip(&self) -> Option<&Rc<dyn Listenable>>
fn reclip(&self) -> Option<&Rc<dyn Listenable>>
Listenable that notifies when it is time to reclip. Read more