Ejemplo n.º 1
0
// cairo_path_t* cairo_copy_path (cairo_t *cr);
func (self *Surface) CopyPath() (PathData, Status) {
	path := C.cairo_copy_path(self.context)
	defer C.cairo_path_destroy(path)

	raw_data := make(PathData, int(path.num_data*2))
	C.memcpy(unsafe.Pointer(&raw_data[0]), unsafe.Pointer(path.data), C.size_t(path.num_data*16))

	return raw_data, Status(path.status)
}
Ejemplo n.º 2
0
//CopyPath returns a copy of the current path.
//
//Originally cairo_copy_path.
func (c *Context) CopyPath() (Path, error) {
	p := C.cairo_copy_path(c.c)
	defer C.cairo_path_destroy(p)
	return cPath(p)
}