From 4517038755f4211da3b5e9afb5567e9d608875da Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 2 Jan 2008 18:10:43 +0000 Subject: + Fix bug #179840, forking of LPEs + Groundwork for fixing transforming LPE bugs. TODO: implement the actual transformation of LPE parameters. (bzr r4367) --- src/sp-shape.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/sp-shape.cpp') diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index f7c9f0e71..4b27ef8ba 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -9,6 +9,7 @@ * Copyright (C) 1999-2002 Lauris Kaplinski * Copyright (C) 2000-2001 Ximian, Inc. * Copyright (C) 2004 John Cliff + * Copyright (C) 2007-2008 Johan Engelen * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -1157,6 +1158,17 @@ sp_shape_get_livepatheffectobject(SPShape *shape) { } } +Inkscape::LivePathEffect::Effect * +sp_shape_get_livepatheffect(SPShape *shape) { + if (!shape) return NULL; + + LivePathEffectObject * lpeobj = sp_shape_get_livepatheffectobject(shape); + if (lpeobj) + return lpeobj->lpe; + else + return NULL; +} + /** * Calls any registered handlers for the update_patheffect action */ @@ -1219,6 +1231,14 @@ void sp_shape_set_path_effect(SPShape *shape, gchar *value) } } +void sp_shape_set_path_effect(SPShape *shape, LivePathEffectObject * new_lpeobj) +{ + const gchar * repr_id = SP_OBJECT_REPR(new_lpeobj)->attribute("id"); + gchar *hrefstr = g_strdup_printf("#%s", repr_id); + sp_shape_set_path_effect(shape, hrefstr); + g_free(hrefstr); +} + void sp_shape_remove_path_effect(SPShape *shape) { Inkscape::XML::Node *repr = SP_OBJECT_REPR(shape); -- cgit v1.2.3