diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-03-14 22:02:47 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-03-26 17:48:34 +0000 |
| commit | 01b27a996de7aa03e5ec7b961ffd7d0f2e8625c6 (patch) | |
| tree | e1ebbf6b158fbe8d308e2f5518c90cd17c182fb5 /src | |
| parent | Allow path move (diff) | |
| download | inkscape-01b27a996de7aa03e5ec7b961ffd7d0f2e8625c6.tar.gz inkscape-01b27a996de7aa03e5ec7b961ffd7d0f2e8625c6.zip | |
Allow upadate shapen innside groups with LPE
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.cpp | 1 | ||||
| -rw-r--r-- | src/live_effects/lpe-powerclip.cpp | 1 | ||||
| -rw-r--r-- | src/object/box3d-side.cpp | 2 | ||||
| -rw-r--r-- | src/object/sp-ellipse.cpp | 2 | ||||
| -rw-r--r-- | src/object/sp-item-group.cpp | 2 | ||||
| -rw-r--r-- | src/object/sp-rect.cpp | 2 | ||||
| -rw-r--r-- | src/object/sp-shape.cpp | 5 | ||||
| -rw-r--r-- | src/object/sp-spiral.cpp | 2 | ||||
| -rw-r--r-- | src/object/sp-star.cpp | 2 | ||||
| -rw-r--r-- | src/path-chemistry.cpp | 4 | ||||
| -rw-r--r-- | src/ui/tools/arc-tool.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/calligraphic-tool.cpp | 1 | ||||
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 9 | ||||
| -rw-r--r-- | src/ui/tools/freehand-base.cpp | 5 | ||||
| -rw-r--r-- | src/ui/tools/rect-tool.cpp | 6 | ||||
| -rw-r--r-- | src/ui/tools/spiral-tool.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/star-tool.cpp | 3 |
17 files changed, 34 insertions, 17 deletions
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index 6bf2a78bd..8071c19d2 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -213,6 +213,7 @@ LPECopyRotate::cloneD(SPObject *orig, SPObject *dest, Geom::Affine transform, bo SPPath * path = SP_PATH(dest); if (shape && !path) { const char * id = dest->getId(); + shape->removeAllPathEffects(true); Inkscape::XML::Node *dest_node = sp_selected_item_to_curved_repr(SP_ITEM(dest), 0); dest->updateRepr(xml_doc, dest_node, SP_OBJECT_WRITE_ALL); dest->getRepr()->setAttribute("d", id); diff --git a/src/live_effects/lpe-powerclip.cpp b/src/live_effects/lpe-powerclip.cpp index 60237b54e..b27dea3e7 100644 --- a/src/live_effects/lpe-powerclip.cpp +++ b/src/live_effects/lpe-powerclip.cpp @@ -98,6 +98,7 @@ LPEPowerClip::doBeforeEffect (SPLPEItem const* lpeitem){ return; } Inkscape::XML::Document *xml_doc = document->getReprDoc(); + SP_SHAPE(clip_data)->removeAllPathEffects(true); Inkscape::XML::Node *clip_path_node = sp_selected_item_to_curved_repr(SP_ITEM(clip_data), 0); // remember the position of the item gint pos = clip_data->getRepr()->position(); diff --git a/src/object/box3d-side.cpp b/src/object/box3d-side.cpp index 6ecd3a1fa..23c066b1c 100644 --- a/src/object/box3d-side.cpp +++ b/src/object/box3d-side.cpp @@ -198,7 +198,7 @@ void Box3DSide::set_shape() { if (before || this->hasPathEffectRecursive()) { if (!before || before->get_pathvector() != c->get_pathvector()){ this->setCurveBeforeLPE(c); - this->update_patheffect(false); + sp_lpe_item_update_patheffect(this, true, false); } else { this->setCurveBeforeLPE(c); } diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp index 95bfd6160..e1992e4ad 100644 --- a/src/object/sp-ellipse.cpp +++ b/src/object/sp-ellipse.cpp @@ -483,7 +483,7 @@ void SPGenericEllipse::set_shape() if (before || this->hasPathEffectRecursive()) { if (!before || before->get_pathvector() != c->get_pathvector()){ this->setCurveBeforeLPE(c); - this->update_patheffect(false); + sp_lpe_item_update_patheffect(this, true, false); } else { this->setCurveBeforeLPE(c); } diff --git a/src/object/sp-item-group.cpp b/src/object/sp-item-group.cpp index a3fa6c6e8..990634b72 100644 --- a/src/object/sp-item-group.cpp +++ b/src/object/sp-item-group.cpp @@ -197,7 +197,7 @@ void SPGroup::update(SPCtx *ctx, unsigned int flags) { } void SPGroup::modified(guint flags) { - // std::cout << "SPGroup::modified(): " << (getId()?getId():"null") << std::endl; + //std::cout << "SPGroup::modified(): " << (getId()?getId():"null") << std::endl; SPLPEItem::modified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; diff --git a/src/object/sp-rect.cpp b/src/object/sp-rect.cpp index f21dafd54..9e20c6f6a 100644 --- a/src/object/sp-rect.cpp +++ b/src/object/sp-rect.cpp @@ -269,7 +269,7 @@ void SPRect::set_shape() { this->setCurveBeforeLPE(c); // LPE is not applied because result can generally not be represented as SPRect - + c->unref(); } diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp index 0ed5f731b..0687ef1fa 100644 --- a/src/object/sp-shape.cpp +++ b/src/object/sp-shape.cpp @@ -754,8 +754,7 @@ void SPShape::update_patheffect(bool write) this->applyToClipPath(this); this->applyToMask(this); } - } - + } if (write && success) { Inkscape::XML::Node *repr = this->getRepr(); if (c_lpe != NULL) { @@ -765,9 +764,9 @@ void SPShape::update_patheffect(bool write) } else { repr->setAttribute("d", NULL); } + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } c_lpe->unref(); - this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } } diff --git a/src/object/sp-spiral.cpp b/src/object/sp-spiral.cpp index 7a449807d..007e8c499 100644 --- a/src/object/sp-spiral.cpp +++ b/src/object/sp-spiral.cpp @@ -351,7 +351,7 @@ void SPSpiral::set_shape() { if (before || this->hasPathEffectRecursive()) { if (!before || before->get_pathvector() != c->get_pathvector()){ this->setCurveBeforeLPE(c); - this->update_patheffect(false); + sp_lpe_item_update_patheffect(this, true, false); } else { this->setCurveBeforeLPE(c); } diff --git a/src/object/sp-star.cpp b/src/object/sp-star.cpp index 097b5d989..27e1ce201 100644 --- a/src/object/sp-star.cpp +++ b/src/object/sp-star.cpp @@ -434,7 +434,7 @@ void SPStar::set_shape() { if (before || this->hasPathEffectRecursive()) { if (!before || before->get_pathvector() != c->get_pathvector()){ this->setCurveBeforeLPE(c); - this->update_patheffect(false); + sp_lpe_item_update_patheffect(this, true, false); } else { this->setCurveBeforeLPE(c); } diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 7d5346f31..5af000967 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -381,7 +381,7 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& } SPPath *path = dynamic_cast<SPPath *>(item); - if (path && !path->_curve_before_lpe) { + if (path && !path->hasPathEffect()) { // remove connector attributes if (item->getAttribute("inkscape:connector-type") != NULL) { item->removeAttribute("inkscape:connection-start"); @@ -576,7 +576,7 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) { SPShape *shape = dynamic_cast<SPShape *>(item); if (shape) { - curve = shape->getCurve(); + curve = shape->getCurveForEdit(); } } diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp index e620b7cb1..34b29f3bb 100644 --- a/src/ui/tools/arc-tool.cpp +++ b/src/ui/tools/arc-tool.cpp @@ -425,7 +425,7 @@ void ArcTool::finishItem() { desktop->getSelection()->set(this->arc); - DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_ARC, _("Create ellipse")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_ARC, _("Create ellipse")); this->arc = NULL; } diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp index ccf5e3be5..c080571d0 100644 --- a/src/ui/tools/calligraphic-tool.cpp +++ b/src/ui/tools/calligraphic-tool.cpp @@ -948,7 +948,6 @@ void CalligraphicTool::set_to_accumulated(bool unionize, bool subtract) { // This is its result. result = desktop->getSelection()->singleItem(); } - result->doWriteTransform(result->transform, NULL, true); } else { if (this->repr) { diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 8bf4ad82d..07c9c118b 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -835,8 +835,13 @@ void EraserTool::set_to_accumulated() { selection->clear(); if ( wasSelection ) { - if ( !remainingItems.empty() ) { - selection->add(remainingItems.begin(), remainingItems.end()); + for (std::vector<SPItem*>::const_iterator j = remainingItems.begin(); j != remainingItems.end(); ++j){ + SPItem * item = *j; + SPLPEItem * lpeitem = dynamic_cast<SPLPEItem *>(item); + if (lpeitem->hasPathEffectRecursive()) { + sp_lpe_item_update_patheffect (lpeitem, true, false); + } + selection->add(item); } } } diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 76aff2c0e..974a97995 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -588,7 +588,10 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, sp_repr_css_attr_unref(css); return; } - + SPLPEItem * lpeitem = dynamic_cast<SPLPEItem *>(item); + if (!lpeitem->hasPathEffect() && lpeitem->hasPathEffectRecursive()) { + sp_lpe_item_update_patheffect (lpeitem, true, false); + } if (dc->waiting_LPE_type != INVALID_LPE) { Effect::createAndApply(dc->waiting_LPE_type, dc->desktop->doc(), item); dc->waiting_LPE_type = INVALID_LPE; diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 60524b275..7442c6eca 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -460,9 +460,13 @@ void RectTool::finishItem() { this->rect->doWriteTransform(this->rect->transform, NULL, true); this->desktop->canvas->endForcedFullRedraws(); - + this->desktop->getSelection()->set(this->rect); + if (this->rect->hasPathEffectRecursive()) { + this->desktop->getSelection()->toCurves(); + } + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_RECT, _("Create rectangle")); this->rect = NULL; diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp index 7a1881295..66779c3a1 100644 --- a/src/ui/tools/spiral-tool.cpp +++ b/src/ui/tools/spiral-tool.cpp @@ -398,6 +398,8 @@ void SpiralTool::finishItem() { this->desktop->canvas->endForcedFullRedraws(); this->desktop->getSelection()->set(this->spiral); + this->desktop->getSelection()->set(this->spiral); + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPIRAL, _("Create spiral")); this->spiral = NULL; diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp index d6fcf0409..9712bb7bd 100644 --- a/src/ui/tools/star-tool.cpp +++ b/src/ui/tools/star-tool.cpp @@ -421,6 +421,9 @@ void StarTool::finishItem() { desktop->canvas->endForcedFullRedraws(); desktop->getSelection()->set(this->star); + if (this->star->hasPathEffectRecursive()) { + sp_lpe_item_update_patheffect (this->star, true, false); + } DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_STAR, _("Create star")); |
