diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-03-28 20:49:55 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-03-28 20:49:55 +0000 |
| commit | 9d5b761169b927286a66913d75a124d8286e51c3 (patch) | |
| tree | 7ab6ba1918680c97d4bb2f509e855a6ff384397b /src | |
| parent | fix lpe-PathPAram when deleting the path that it links to (diff) | |
| download | inkscape-9d5b761169b927286a66913d75a124d8286e51c3.tar.gz inkscape-9d5b761169b927286a66913d75a124d8286e51c3.zip | |
when applying LPE to rect, convert it to path first
(bzr r5223)
Diffstat (limited to 'src')
| -rw-r--r-- | src/path-chemistry.cpp | 8 | ||||
| -rw-r--r-- | src/path-chemistry.h | 2 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-editor.cpp | 8 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 49c1a1063..cfdbc0b54 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -261,9 +261,13 @@ sp_selected_path_break_apart(void) /* This function is an entry point from GUI */ void -sp_selected_path_to_curves(void) +sp_selected_path_to_curves(bool interactive) { - sp_selected_path_to_curves0(TRUE, SP_TOCURVE_INTERACTIVE); + if (interactive) { + sp_selected_path_to_curves0(TRUE, SP_TOCURVE_INTERACTIVE); + } else { + sp_selected_path_to_curves0(false, 0); + } } static void diff --git a/src/path-chemistry.h b/src/path-chemistry.h index 52b3b189d..a715833d0 100644 --- a/src/path-chemistry.h +++ b/src/path-chemistry.h @@ -17,7 +17,7 @@ void sp_selected_path_combine (void); void sp_selected_path_break_apart (void); -void sp_selected_path_to_curves (void); +void sp_selected_path_to_curves (bool interactive = true); Inkscape::XML::Node *sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy); void sp_selected_path_reverse (); diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 2394adc6f..f62556d23 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -22,6 +22,8 @@ #include "sp-shape.h" #include "sp-item-group.h" #include "sp-path.h" +#include "sp-rect.h" +#include "path-chemistry.h" #include "live_effects/effect.h" #include "live_effects/lpeobject.h" #include "gtkmm/widget.h" @@ -229,6 +231,12 @@ LivePathEffectEditor::onApply() const Util::EnumData<LivePathEffect::EffectType>* data = combo_effecttype.get_active_data(); if (!data) return; + // If item is a SPRect, convert it to path first: + if ( SP_IS_RECT(item) ) { + sp_selected_path_to_curves(false); + item = sel->singleItem(); // get new item + } + // Path effect definition Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = xml_doc->createElement("inkscape:path-effect"); |
