diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-01 10:23:50 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-01 10:23:50 +0000 |
| commit | 2c971fd0dd67269a5ecd6c3323071e8b0b08bf1b (patch) | |
| tree | 46f82df97d9942e6718e4d26281e10ed89e8a2bb /src/selection-chemistry.cpp | |
| parent | Fix a bug converting to paths nested LPE with powerstroke (diff) | |
| download | inkscape-2c971fd0dd67269a5ecd6c3323071e8b0b08bf1b.tar.gz inkscape-2c971fd0dd67269a5ecd6c3323071e8b0b08bf1b.zip | |
Add widget to color and some refactoring
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 0bd611163..24113f976 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -95,6 +95,8 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include "ui/tool/control-point-selection.h" #include "ui/tool/multi-path-manipulator.h" #include "live_effects/effect.h" +#include "live_effects/lpe-powerclip.h" +#include "live_effects/lpe-powermask.h" #include "live_effects/parameter/originalpath.h" #include "layer-manager.h" #include "object-set.h" @@ -3862,7 +3864,7 @@ void ObjectSet::setClipGroup() * If \a apply_clip_path parameter is true, clipPath is created, otherwise mask * */ - void ObjectSet::setMask(bool apply_clip_path, bool apply_to_layer, bool skip_undo) + void ObjectSet::setMask(bool apply_clip_path, bool apply_to_layer, bool skip_undo, bool inverse) { if(!desktop() && apply_to_layer) return; @@ -4016,7 +4018,26 @@ void ObjectSet::setClipGroup() } apply_mask_to->setAttribute(attributeName, Glib::ustring("url(#") + mask_id + ')'); - + if (inverse) { + using namespace Inkscape::LivePathEffect; + if (apply_clip_path) { + Effect::createAndApply(POWERCLIP, doc, item); + Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE(); + lpe->getRepr()->setAttribute("is_inverse", "false"); + lpe->getRepr()->setAttribute("is_visible", "true"); + lpe->getRepr()->setAttribute("inverse", "true"); + lpe->getRepr()->setAttribute("flatten", "false"); + lpe->getRepr()->setAttribute("hide_clip", "false"); + } else { + Effect::createAndApply(POWERMASK, doc, item); + Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE(); + lpe->getRepr()->setAttribute("invert", "false"); + lpe->getRepr()->setAttribute("is_visible", "true"); + lpe->getRepr()->setAttribute("hide_mask", "false"); + lpe->getRepr()->setAttribute("background", "true"); + lpe->getRepr()->setAttribute("background_color", "#ffffffff"); + } + } } for (std::vector<SPItem*>::const_iterator i = items_to_delete.begin(); i != items_to_delete.end(); ++i) { |
