Gsk.PathMeasure¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gsk.PathMeasure¶
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
GskPathMeasure
has a tolerance that determines what precision is required for such approximations.A
GskPathMeasure
struct is a reference counted struct and should be treated as opaque.New in version 4.14.
- classmethod new(path)¶
- Parameters:
path (
Gsk.Path
) – the path to measure- Returns:
a new
GskPathMeasure
representing path- Return type:
Creates a measure object for the given path with the default tolerance.
New in version 4.14.
- classmethod new_with_tolerance(path, tolerance)¶
- Parameters:
- Returns:
a new
GskPathMeasure
representing path- Return type:
Creates a measure object for the given path and tolerance.
New in version 4.14.
- get_length()¶
- Returns:
the length of the path measured by self
- Return type:
Gets the length of the path being measured.
The length is cached, so this function does not do any work.
New in version 4.14.
- get_path()¶
- Returns:
the path of self
- Return type:
Returns the path that the measure was created for.
New in version 4.14.
- get_point(distance)¶
- Parameters:
distance (
float
) – the distance- Returns:
true if result was set
- result:
return location for the point
- Return type:
(
bool
, result:Gsk.PathPoint
)
Gets the point at the given distance into the path.
An empty path has no points, so false is returned in that case.
New in version 4.14.
- get_tolerance()¶
- Returns:
the tolerance of self
- Return type:
Returns the tolerance that the measure was created with.
New in version 4.14.
- ref()¶
- Returns:
the passed in
GskPathMeasure
.- Return type:
Increases the reference count of a
GskPathMeasure
by one.New in version 4.14.
- unref()¶
Decreases the reference count of a
GskPathMeasure
by one.If the resulting reference count is zero, frees the object.
New in version 4.14.