From: cilix42 Date: Wed, 18 Jun 2008 22:29:34 +0000 (+0000) Subject: Separate version of sp_nodepath_generate_helperpath() to generate a helperpath from... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a1ad28e1afaab56a574bc2f744cdf1af941ba2c4;p=inkscape.git Separate version of sp_nodepath_generate_helperpath() to generate a helperpath from a SPCurve directly --- diff --git a/src/nodepath.cpp b/src/nodepath.cpp index c9456d17e..0a5993823 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -4741,11 +4741,10 @@ void sp_nodepath_set_curve (Inkscape::NodePath::Path *np, SPCurve *curve) { } SPCanvasItem * -sp_nodepath_generate_helperpath(SPDesktop *desktop, SPPath *path) { - // This should be put somewhere else under the name of "generate helperpath" or something. Because basically this is copied of code from nodepath... - SPCurve *curve_new = sp_path_get_curve_for_edit(path); - SPCurve *flash_curve = curve_new->copy(); - flash_curve->transform(sp_item_i2d_affine(SP_ITEM(path))); +sp_nodepath_generate_helperpath(SPDesktop *desktop, SPCurve *curve, const SPItem *item) { + SPCurve *flash_curve = curve->copy(); + Geom::Matrix i2d = item ? sp_item_i2d_affine(item) : Geom::identity(); + flash_curve->transform(i2d); SPCanvasItem * canvasitem = sp_canvas_bpath_new(sp_desktop_tempgroup(desktop), flash_curve); // would be nice if its color could be XORed or something, now it is invisible for red stroked objects... // unless we also flash the nodes... @@ -4757,6 +4756,11 @@ sp_nodepath_generate_helperpath(SPDesktop *desktop, SPPath *path) { return canvasitem; } +SPCanvasItem * +sp_nodepath_generate_helperpath(SPDesktop *desktop, SPPath *path) { + return sp_nodepath_generate_helperpath(desktop, sp_path_get_curve_for_edit(path), SP_ITEM(path)); +} + void sp_nodepath_show_helperpath(Inkscape::NodePath::Path *np, bool show) { np->show_helperpath = show; diff --git a/src/nodepath.h b/src/nodepath.h index 42bfcfd21..77cf5a518 100644 --- a/src/nodepath.h +++ b/src/nodepath.h @@ -307,6 +307,7 @@ NR::Rect sp_node_selected_bbox (Inkscape::NodePath::Path *nodepath); NR::Maybe sp_node_selected_common_coord (Inkscape::NodePath::Path *nodepath, NR::Dim2 axis); void sp_nodepath_show_handles(Inkscape::NodePath::Path *nodepath, bool show); +SPCanvasItem *sp_nodepath_generate_helperpath(SPDesktop *desktop, SPCurve *curve, const SPItem *item); SPCanvasItem *sp_nodepath_generate_helperpath(SPDesktop *desktop, SPPath *path); void sp_nodepath_show_helperpath(Inkscape::NodePath::Path *nodepath, bool show); void sp_nodepath_make_straight_path(Inkscape::NodePath::Path *np);