diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-12-26 22:57:43 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-12-26 22:57:43 +0000 |
| commit | 6c067ce093126cf23d9b038011b2effa1390fd07 (patch) | |
| tree | 905518b6ea05a64934db2a8e8da961b82b378e8a /src | |
| parent | update to trunk (diff) | |
| download | inkscape-6c067ce093126cf23d9b038011b2effa1390fd07.tar.gz inkscape-6c067ce093126cf23d9b038011b2effa1390fd07.zip | |
warping into a layer
(bzr r13682.1.21)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.cpp | 17 | ||||
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index b0a4831f5..8df2eb176 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -55,6 +55,7 @@ LPEMirrorSymmetry::LPEMirrorSymmetry(LivePathEffectObject *lpeobject) : discard_orig_path(_("Discard original path?"), _("Check this to only keep the mirrored part of the path"), "discard_orig_path", &wr, this, false), fusionPaths(_("Fusioned symetry"), _("Fusion right side whith symm"), "fusionPaths", &wr, this, true), reverseFusion(_("Reverse fusion"), _("Reverse fusion"), "reverseFusion", &wr, this, false), + reflectionFromPage(_("Use page as relecion base"), _("Use page as relecion base"), "reflectionFromPage", &wr, this, false), reflection_line(_("Reflection line:"), _("Line which serves as 'mirror' for the reflection"), "reflection_line", &wr, this, "M0,0 L1,0"), center(_("Center of mirroring (X or Y)"), _("Center of the mirror"), "center", &wr, this, "Adjust the center of mirroring") { @@ -64,6 +65,7 @@ LPEMirrorSymmetry::LPEMirrorSymmetry(LivePathEffectObject *lpeobject) : registerParameter( &discard_orig_path); registerParameter( &fusionPaths); registerParameter( &reverseFusion); + registerParameter( &reflectionFromPage); registerParameter( &reflection_line); registerParameter( ¢er); @@ -73,6 +75,21 @@ LPEMirrorSymmetry::~LPEMirrorSymmetry() { } +void LPEMirrorSymmetry::doOnApply(SPLPEItem const* lpeitem) +{ + SPDocument *doc = lpeitem->document(); + Inkscape::XML::Document *xml_doc = doc->getReprDoc(); + sp_selection_group_impl(GSList *p, group, xml_doc, doc); + Inkscape::XML::Node *group = xml_doc->createElement("svg:g"); + group->setAttribute("inkscape:groupmode", "layer"); + sp_selection_group_impl(p, group, xml_doc, doc); + gchar *href = g_strdup_printf("#%s", this->lpeobject_href); + SP_LPE_ITEM(group)->addPathEffect(href, true); + lpeitem->removeCurrentPathEffect(false) + g_free(href); + Inkscape::GC::release(group); +} + void LPEMirrorSymmetry::doBeforeEffect (SPLPEItem const* lpeitem) { diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h index 8c6c49c7d..6e9e7dd1a 100644 --- a/src/live_effects/lpe-mirror_symmetry.h +++ b/src/live_effects/lpe-mirror_symmetry.h @@ -44,6 +44,8 @@ public: virtual void doOnApply (SPLPEItem const* lpeitem); + virtual void doOnApply(SPLPEItem const* lpeitem); + virtual void doBeforeEffect (SPLPEItem const* lpeitem); virtual int pointSideOfLine(Geom::Point A, Geom::Point B, Geom::Point X); @@ -62,6 +64,7 @@ private: BoolParam discard_orig_path; BoolParam fusionPaths; BoolParam reverseFusion; + BoolParam reflectionFromPage; PathParam reflection_line; Geom::Line lineSeparation; Geom::Point previousCenter; |
