2.6 <GskPathMeasure>

Structure: <GskPathMeasure>

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.

Procedures

Method: path-measure:get-length self ⇒ %return
Method: get-length self ⇒ %return

Gets the length of the path being measured.

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

self

Passed: a <GskPathMeasure>.

a path measure

%return

Returned: a real number.

the length of the path measured by self

Method: path-measure:get-path self ⇒ %return
Method: get-path self ⇒ %return

Returns the path that the measure was created for.

self

Passed: a <GskPathMeasure>.

a path measure

%return

Returned: a <GskPath>.

the path of self

Method: path-measure:get-point! self distance result ⇒ %return result
Method: get-point! self distance result ⇒ %return result

Gets the point at the given distance into the path.

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

self

Passed: a <GskPathMeasure>.

a path measure

distance

Passed: a real number.

the distance

result

Passed, filled in, and returned: a <GskPathPoint>.

return location for the point

%return

Returned: a boolean.

true if result was set

Method: path-measure:get-tolerance self ⇒ %return
Method: get-tolerance self ⇒ %return

Returns the tolerance that the measure was created with.

self

Passed: a <GskPathMeasure>.

a path measure

%return

Returned: a real number.

the tolerance of self

Procedure: path-measure:new path ⇒ %return

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

path

Passed: a <GskPath>.

the path to measure

%return

Returned: a <GskPathMeasure>.

a new <GskPathMeasure> representing path

Procedure: path-measure:new-with-tolerance path tolerance ⇒ %return

Creates a measure object for the given path and tolerance.

path

Passed: a <GskPath>.

the path to measure

tolerance

Passed: a real number.

the tolerance for measuring operations

%return

Returned: a <GskPathMeasure>.

a new <GskPathMeasure> representing path

Method: path-measure:ref self ⇒ %return
Method: ref self ⇒ %return

Increases the reference count of a <GskPathMeasure> by one.

self

Passed: a <GskPathMeasure>.

a path measure

%return

Returned: a <GskPathMeasure>.

the passed in <GskPathMeasure>.

Method: path-measure:unref self
Method: unref self

Decreases the reference count of a <GskPathMeasure> by one.

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

self

Passed: a <GskPathMeasure>.

a path measure