Context.copyPath

cairo.path.Path copyPath()

Creates a copy of the current path and returns it to the user as a #cairo_path_t. See #cairo_path_data_t for hints on how to iterate over the returned data structure.

This function will always return a valid pointer, but the result will have no data (<literal>data==null</literal> and

<literal>num_data==0</literal>), if either of the following

conditions hold:

<orderedlist> <listitem>If there is insufficient memory to copy the path. In this

case <literal>path->status</literal> will be set to [cairo.types.Status.NoMemory].</listitem>

<listitem>If cr is already in an error state. In this case <literal>path->status</literal> will contain the same status that

would be returned by [cairo.context.Context.status].</listitem>

</orderedlist>

Returns

the copy of the current path. The caller owns the

returned object and should call [cairo.path.Path.destroy] when finished with it.