summaryrefslogtreecommitdiffstats
path: root/src/sp-lpe-item.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-24 14:16:06 +0000
committerJabiertxof <jtx@jtx>2017-01-24 14:16:06 +0000
commitb25ebda10578c5d697db9716e3c2b70950d33e45 (patch)
tree4635b8b3f65600cfd54b5465b906ae42165b0674 /src/sp-lpe-item.cpp
parentFix some bugs (diff)
parentfix nodes reverting back during editing (diff)
downloadinkscape-b25ebda10578c5d697db9716e3c2b70950d33e45.tar.gz
inkscape-b25ebda10578c5d697db9716e3c2b70950d33e45.zip
fixing to new trunk
(bzr r15142.1.38)
Diffstat (limited to 'src/sp-lpe-item.cpp')
-rw-r--r--src/sp-lpe-item.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 8f0713652..e2f61bfb5 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -125,7 +125,8 @@ void SPLPEItem::set(unsigned int key, gchar const* value) {
{
if (!value) {
LivePathEffectObject *lpeobj = (*it)->lpeobject;
- if (Inkscape::LivePathEffect::LPEMeasureLine * lpe = dynamic_cast<Inkscape::LivePathEffect::LPEMeasureLine *>(lpeobj->get_lpe())) {
+ Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe();
+ if (dynamic_cast<Inkscape::LivePathEffect::LPEMeasureLine *>(lpe)){
lpe->doOnRemove(this);
}
}
@@ -289,22 +290,6 @@ sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write)
if (!lpeitem->pathEffectsEnabled())
return;
- // TODO: hack! this will be removed when path length measuring is reimplemented in a better way
- PathEffectList lpelist = lpeitem->getEffectList();
- std::list<Inkscape::LivePathEffect::LPEObjectReference *>::iterator i;
- for (i = lpelist.begin(); i != lpelist.end(); ++i) {
- if ((*i)->lpeobject) {
- Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->get_lpe();
- if (dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)) {
- if (!lpe->isVisible()) {
- // we manually disable text for LPEPathLength
- // use static_cast, because we already checked for the right type above
- static_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)->hideCanvasText();
- }
- }
- }
- }
-
SPLPEItem *top = NULL;
if (wholetree) {
@@ -514,6 +499,21 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths)
*/
void SPLPEItem::removeAllPathEffects(bool keep_paths)
{
+ if (keep_paths) {
+ if (path_effect_list->empty()) {
+ return;
+ }
+
+ for (PathEffectList::const_iterator it = path_effect_list->begin(); it != path_effect_list->end(); ++it)
+ {
+ LivePathEffectObject *lpeobj = (*it)->lpeobject;
+ if (lpeobj) {
+ Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe();
+ lpe->erase_extra_objects = false;
+ }
+ }
+ }
+
this->getRepr()->setAttribute("inkscape:path-effect", NULL);
if (!keep_paths) {