diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-04-14 16:50:20 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-04-14 16:50:20 +0000 |
| commit | 75fa525a68af3ac9826dca66f00fb01f6efa3c51 (patch) | |
| tree | 3c866e9cb68cbef7572cd79ce9eb687d9f97c050 /src/object | |
| parent | Add files missing in last commit (FontSelector). (diff) | |
| download | inkscape-75fa525a68af3ac9826dca66f00fb01f6efa3c51.tar.gz inkscape-75fa525a68af3ac9826dca66f00fb01f6efa3c51.zip | |
Fixes to transforms on LPE
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/sp-item.cpp | 7 | ||||
| -rw-r--r-- | src/object/sp-lpe-item.cpp | 21 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp index a228d9313..4b4d3e7cd 100644 --- a/src/object/sp-item.cpp +++ b/src/object/sp-item.cpp @@ -1536,14 +1536,17 @@ void SPItem::doWriteTransform(Geom::Affine const &transform, Geom::Affine const } set_item_transform(transform_attr); - - // Note: updateRepr comes before emitting the transformed signal since // it causes clone SPUse's copy of the original object to brought up to // date with the original. Otherwise, sp_use_bbox returns incorrect // values if called in code handling the transformed signal. updateRepr(); + SPLPEItem * lpeitem = SP_LPE_ITEM(this); + if (lpeitem && lpeitem->hasPathEffectRecursive()) { + sp_lpe_item_update_patheffect(lpeitem, false, false); + } + // send the relative transform with a _transformed_signal _transformed_signal.emit(&advertized_transform, this); } diff --git a/src/object/sp-lpe-item.cpp b/src/object/sp-lpe-item.cpp index abe08a1dc..7ff0a88d6 100644 --- a/src/object/sp-lpe-item.cpp +++ b/src/object/sp-lpe-item.cpp @@ -420,6 +420,9 @@ sp_lpe_item_cleanup_original_path_recursive(SPLPEItem *lpeitem, bool keep_paths, } repr->setAttribute("inkscape:original-d", NULL); path->setCurveBeforeLPE(NULL); + if (!(shape->getCurve()->get_segment_count())) { + repr->parent()->removeChild(repr); + } } else { if (!keep_paths) { sp_lpe_item_update_patheffect(lpeitem, true, true); @@ -530,17 +533,17 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths) if (Inkscape::LivePathEffect::Effect* effect_ = this->getCurrentLPE()) { effect_->keep_paths = keep_paths; effect_->doOnRemove(this); - } - PathEffectList new_list = *this->path_effect_list; - new_list.remove(lperef); //current lpe ref is always our 'own' pointer from the path_effect_list - this->getRepr()->setAttribute("inkscape:path-effect", patheffectlist_svg_string(new_list)); - if (!keep_paths) { - // Make sure that ellipse is stored as <svg:circle> or <svg:ellipse> if possible. - if( SP_IS_GENERICELLIPSE(this)) { - SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); + PathEffectList new_list = *this->path_effect_list; + new_list.remove(lperef); //current lpe ref is always our 'own' pointer from the path_effect_list + this->getRepr()->setAttribute("inkscape:path-effect", patheffectlist_svg_string(new_list)); + if (!keep_paths) { + // Make sure that ellipse is stored as <svg:circle> or <svg:ellipse> if possible. + if( SP_IS_GENERICELLIPSE(this)) { + SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); + } } + sp_lpe_item_cleanup_original_path_recursive(this, keep_paths); } - sp_lpe_item_cleanup_original_path_recursive(this, keep_paths); } /** |
