/** * gnome_canvas_path_def_ensure_space: * @path: a GnomeCanvasPathDef * @space: number of points to guarantee are allocated at the end of * the path. * * This function ensures that enough space for @space points is * allocated at the end of the path. */ void gnome_canvas_path_def_ensure_space (GnomeCanvasPathDef * path, gint space) { g_return_if_fail (path != NULL); g_return_if_fail (space > 0); if (path->end + space < path->length) return; if (space < GNOME_CANVAS_PATH_DEF_LENSTEP) space = GNOME_CANVAS_PATH_DEF_LENSTEP; path->bpath = art_renew (path->bpath, ArtBpath, path->length + space); path->length += space; }
void gp_path_ensure_space (GPPath * path, gint space) { g_return_if_fail (path != NULL); g_return_if_fail (space > 0); if (path->end + space < path->length) return; if (space < GP_PATH_LENSTEP) space = GP_PATH_LENSTEP; path->bpath = art_renew (path->bpath, ArtBpath, path->length + space); path->length += space; }
static int path_get_element(Path* path, double x, double y) { int n = path->end; if (n+1 >= path->size) { path->size += 16; path->bpath = art_renew (path->bpath, ArtBpath, path->size); if (!path->bpath) return -1; } path->bpath[++path->end].code = ART_END; return n; }
/** * gnome_canvas_path_def_finish: * @path: a GnomeCanvasPathDef * * Trims dynamic point array to exact length of path. */ void gnome_canvas_path_def_finish (GnomeCanvasPathDef * path) { g_return_if_fail (path != NULL); g_return_if_fail (path->sbpath); if ((path->end + 1) < path->length) { path->bpath = art_renew (path->bpath, ArtBpath, path->end + 1); path->length = path->end + 1; } path->hascpt = FALSE; path->posset = FALSE; path->moving = FALSE; }
void gp_path_finish (GPPath * path) { g_return_if_fail (path != NULL); g_return_if_fail (path->sbpath); if ((path->end + 1) < path->length) { path->bpath = art_renew (path->bpath, ArtBpath, path->end + 1); path->length = path->end + 1; } path->hascpt = FALSE; path->posset = FALSE; path->moving = FALSE; }