PathMeasure

Added in version 4.14.

class PathMeasure(**kwargs)
Constructors:

new(path:Gsk.Path) -> Gsk.PathMeasure
new_with_tolerance(path:Gsk.Path, tolerance:float) -> Gsk.PathMeasure

Constructors

class PathMeasure
classmethod new(path: Path) PathMeasure

Creates a measure object for the given path with the default tolerance.

Added in version 4.14.

Parameters:

path – the path to measure

classmethod new_with_tolerance(path: Path, tolerance: float) PathMeasure

Creates a measure object for the given path and tolerance.

Added in version 4.14.

Parameters:
  • path – the path to measure

  • tolerance – the tolerance for measuring operations

Methods

class PathMeasure
get_length() float

Gets the length of the path being measured.

The length is cached, so this function does not do any work.

Added in version 4.14.

get_path() Path

Returns the path that the measure was created for.

Added in version 4.14.

get_point(distance: float) tuple[bool, PathPoint]

Sets result to the point at the given distance into the path.

An empty path has no points, so FALSE is returned in that case.

Added in version 4.14.

Parameters:

distance – the distance

get_tolerance() float

Returns the tolerance that the measure was created with.

Added in version 4.14.