pub type ContourMeasure = RCHandle<SkContourMeasure>;Aliased Type§
pub struct ContourMeasure(/* private fields */);Implementations§
Source§impl ContourMeasure
impl ContourMeasure
Sourcepub fn pos_tan(&self, distance: scalar) -> Option<(Point, Vector)>
pub fn pos_tan(&self, distance: scalar) -> Option<(Point, Vector)>
Pins distance to 0 <= distance <= length(), then computes the corresponding
position and tangent.
distance: distance along the contour.
Sourcepub fn get_matrix(
&self,
distance: scalar,
flags: impl Into<Option<MatrixFlags>>,
) -> Option<Matrix>
pub fn get_matrix( &self, distance: scalar, flags: impl Into<Option<MatrixFlags>>, ) -> Option<Matrix>
Pins distance to 0 <= distance <= length(), then computes the corresponding
matrix (by calling Self::pos_tan()).
Returns None if there is no path, or a zero-length path was specified.
distance: distance along the contour.flags: controls whether position, tangent, or both are computed.
Sourcepub fn segment(
&self,
start_d: scalar,
stop_d: scalar,
path_builder: &mut PathBuilder,
start_with_move_to: bool,
) -> bool
👎Deprecated since 0.94.0: Use get_segment()
pub fn segment( &self, start_d: scalar, stop_d: scalar, path_builder: &mut PathBuilder, start_with_move_to: bool, ) -> bool
Given a start and stop distance, appends the intervening segment(s) to path_builder.
If the segment is zero-length, returns false; otherwise returns true.
start_d and stop_d are pinned to legal values (0..length()). If
start_d > stop_d, returns false and leaves path_builder untouched.
Begins the segment with a move_to if start_with_move_to is true.
start_d: start distance along the contour.stop_d: stop distance along the contour.path_builder: destination that receives the segment.start_with_move_to: whether to begin withmove_to.
Sourcepub fn get_segment(
&self,
start_d: scalar,
stop_d: scalar,
path_builder: &mut PathBuilder,
start_with_move_to: bool,
) -> bool
pub fn get_segment( &self, start_d: scalar, stop_d: scalar, path_builder: &mut PathBuilder, start_with_move_to: bool, ) -> bool
Given a start and stop distance, appends the intervening segment(s) to path_builder.
If the segment is zero-length, returns false; otherwise returns true.
start_d and stop_d are pinned to legal values (0..length()). If
start_d > stop_d, returns false and leaves path_builder untouched.
Begins the segment with a move_to if start_with_move_to is true.
start_d: start distance along the contour.stop_d: stop distance along the contour.path_builder: destination that receives the segment.start_with_move_to: whether to begin withmove_to.
Sourcepub fn verbs(&self) -> ForwardVerbIterator<'_> ⓘ
pub fn verbs(&self) -> ForwardVerbIterator<'_> ⓘ
Returns an iterator over measurement data for the contour’s verbs.