Gsk.PathMeasure

Fields

None

Methods

class

new (path)

class

new_with_tolerance (path, tolerance)

get_length ()

get_path ()

get_point (distance)

get_tolerance ()

ref ()

unref ()

Details

class Gsk.PathMeasure

Performs 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.

Added in version 4.14.

classmethod new(path)
Parameters:

path (Gsk.Path) – the path to measure

Returns:

a new GskPathMeasure representing path

Return type:

Gsk.PathMeasure

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

Added in version 4.14.

classmethod new_with_tolerance(path, tolerance)
Parameters:
  • path (Gsk.Path) – the path to measure

  • tolerance (float) – the tolerance for measuring operations

Returns:

a new GskPathMeasure representing path

Return type:

Gsk.PathMeasure

Creates a measure object for the given path and tolerance.

Added in version 4.14.

get_length()
Returns:

the length of the path measured by self

Return type:

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()
Returns:

the path of self

Return type:

Gsk.Path

Returns the path that the measure was created for.

Added 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.

Added in version 4.14.

get_tolerance()
Returns:

the tolerance of self

Return type:

float

Returns the tolerance that the measure was created with.

Added in version 4.14.

ref()
Returns:

the passed in GskPathMeasure.

Return type:

Gsk.PathMeasure

Increases the reference count of a GskPathMeasure by one.

Added in version 4.14.

unref()

Decreases the reference count of a GskPathMeasure by one.

If the resulting reference count is zero, frees the object.

Added in version 4.14.