Struct gsk4::PathMeasure
source · pub struct PathMeasure { /* private fields */ }v4_14 only.Expand description
PathMeasure is an object that allows measurements
on Paths such as determining the length of the path.
Many measuring operations require sampling the path length
at intermediate points. Therefore, a PathMeasure has
a tolerance that determines what precision is required
for such approximations.
A PathMeasure struct is a reference counted struct
and should be treated as opaque.
Implementations§
source§impl PathMeasure
impl PathMeasure
sourcepub fn as_ptr(&self) -> *mut GskPathMeasure
pub fn as_ptr(&self) -> *mut GskPathMeasure
Return the inner pointer to the underlying C value.
sourcepub unsafe fn from_glib_ptr_borrow<'a>(
ptr: *const *const GskPathMeasure
) -> &'a Self
pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const *const GskPathMeasure ) -> &'a Self
Borrows the underlying C value.
source§impl PathMeasure
impl PathMeasure
sourcepub fn new(path: &Path) -> PathMeasure
pub fn new(path: &Path) -> PathMeasure
Creates a measure object for the given @path with the default tolerance.
§path
the path to measure
§Returns
a new PathMeasure representing @path
sourcepub fn with_tolerance(path: &Path, tolerance: f32) -> PathMeasure
pub fn with_tolerance(path: &Path, tolerance: f32) -> PathMeasure
Creates a measure object for the given @path and @tolerance.
§path
the path to measure
§tolerance
the tolerance for measuring operations
§Returns
a new PathMeasure representing @path
sourcepub fn length(&self) -> f32
pub fn length(&self) -> f32
Gets the length of the path being measured.
The length is cached, so this function does not do any work.
§Returns
The length of the path measured by @self
Trait Implementations§
source§impl Clone for PathMeasure
impl Clone for PathMeasure
source§impl Debug for PathMeasure
impl Debug for PathMeasure
source§impl From<PathMeasure> for Value
impl From<PathMeasure> for Value
source§fn from(s: PathMeasure) -> Self
fn from(s: PathMeasure) -> Self
source§impl HasParamSpec for PathMeasure
impl HasParamSpec for PathMeasure
type ParamSpec = ParamSpecBoxed
§type SetValue = PathMeasure
type SetValue = PathMeasure
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, PathMeasure>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for PathMeasure
impl Hash for PathMeasure
source§impl Ord for PathMeasure
impl Ord for PathMeasure
source§fn cmp(&self, other: &PathMeasure) -> Ordering
fn cmp(&self, other: &PathMeasure) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for PathMeasure
impl PartialEq for PathMeasure
source§fn eq(&self, other: &PathMeasure) -> bool
fn eq(&self, other: &PathMeasure) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for PathMeasure
impl PartialOrd for PathMeasure
source§fn partial_cmp(&self, other: &PathMeasure) -> Option<Ordering>
fn partial_cmp(&self, other: &PathMeasure) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl StaticType for PathMeasure
impl StaticType for PathMeasure
source§fn static_type() -> Type
fn static_type() -> Type
Self.