summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-09-29 17:38:18 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-09-29 17:38:18 +0000
commitb5b69ed38101efb51632b9c7ad4a25a5b13ca98c (patch)
treed9abc106c62b06bdf5fd422317b08b3288475b0b /src/object
parentCI/AppVeyor: Escape from DLL hell (diff)
downloadinkscape-b5b69ed38101efb51632b9c7ad4a25a5b13ca98c.tar.gz
inkscape-b5b69ed38101efb51632b9c7ad4a25a5b13ca98c.zip
Fix for bug: #1791784 LPE path effect undo does not work
Diffstat (limited to 'src/object')
-rw-r--r--src/object/box3d-side.cpp9
-rw-r--r--src/object/sp-ellipse.cpp8
-rw-r--r--src/object/sp-object.cpp11
-rw-r--r--src/object/sp-path.cpp9
-rw-r--r--src/object/sp-spiral.cpp8
-rw-r--r--src/object/sp-star.cpp8
6 files changed, 39 insertions, 14 deletions
diff --git a/src/object/box3d-side.cpp b/src/object/box3d-side.cpp
index d3ea2c890..f90b3e9ff 100644
--- a/src/object/box3d-side.cpp
+++ b/src/object/box3d-side.cpp
@@ -194,16 +194,21 @@ void Box3DSide::set_shape() {
/* Reset the shape's curve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
SPCurve * before = this->getCurveBeforeLPE();
- if (before || this->hasPathEffectRecursive()) {
+ bool haslpe = this->hasPathEffectOnClipOrMaskRecursive(this);
+ if (before || haslpe) {
if (c && before && before->get_pathvector() != c->get_pathvector()){
this->setCurveBeforeLPE(c);
sp_lpe_item_update_patheffect(this, true, false);
- } else {
+ } else if(haslpe) {
this->setCurveBeforeLPE(c);
+ } else {
+ //This happends on undo, fix bug:#1791784
+ this->setCurveInsync(c);
}
} else {
this->setCurveInsync(c);
}
+
if (before) {
before->unref();
}
diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp
index 723c28625..a3ac66838 100644
--- a/src/object/sp-ellipse.cpp
+++ b/src/object/sp-ellipse.cpp
@@ -479,12 +479,16 @@ void SPGenericEllipse::set_shape()
/* Reset the shape's curve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
SPCurve * before = this->getCurveBeforeLPE();
- if (before || this->hasPathEffectRecursive()) {
+ bool haslpe = this->hasPathEffectOnClipOrMaskRecursive(this);
+ if (before || haslpe) {
if (c && before && before->get_pathvector() != c->get_pathvector()){
this->setCurveBeforeLPE(c);
sp_lpe_item_update_patheffect(this, true, false);
- } else {
+ } else if(haslpe) {
this->setCurveBeforeLPE(c);
+ } else {
+ //This happends on undo, fix bug:#1791784
+ this->setCurveInsync(c);
}
} else {
this->setCurveInsync(c);
diff --git a/src/object/sp-object.cpp b/src/object/sp-object.cpp
index c76196d98..93a3f131a 100644
--- a/src/object/sp-object.cpp
+++ b/src/object/sp-object.cpp
@@ -1200,9 +1200,10 @@ void SPObject::requestDisplayUpdate(unsigned int flags)
#endif
bool already_propagated = (!(this->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG)));
-
- this->uflags |= flags;
-
+ //https://stackoverflow.com/a/7841333
+ if ((this->uflags & flags) != flags ) {
+ this->uflags |= flags;
+ }
/* If requestModified has already been called on this object or one of its children, then we
* don't need to set CHILD_MODIFIED on our ancestors because it's already been done.
*/
@@ -1210,7 +1211,9 @@ void SPObject::requestDisplayUpdate(unsigned int flags)
if (parent) {
parent->requestDisplayUpdate(SP_OBJECT_CHILD_MODIFIED_FLAG);
} else {
- document->requestModified();
+ if(this->document) {
+ this->document->requestModified();
+ }
}
}
diff --git a/src/object/sp-path.cpp b/src/object/sp-path.cpp
index f0e961d8c..cf8c0ad10 100644
--- a/src/object/sp-path.cpp
+++ b/src/object/sp-path.cpp
@@ -227,8 +227,13 @@ void SPPath::set(unsigned int key, const gchar* value) {
curve->unref();
}
} else {
- this->setCurveBeforeLPE(nullptr);
-
+ bool haslpe = this->hasPathEffectOnClipOrMaskRecursive(this);
+ if (!haslpe) {
+ this->setCurveBeforeLPE(nullptr);
+ } else {
+ //This happends on undo, fix bug:#1791784
+ this->removeAllPathEffects(false);
+ }
}
sp_lpe_item_update_patheffect(this, true, true);
break;
diff --git a/src/object/sp-spiral.cpp b/src/object/sp-spiral.cpp
index da4f18923..ba4cc0ce5 100644
--- a/src/object/sp-spiral.cpp
+++ b/src/object/sp-spiral.cpp
@@ -347,12 +347,16 @@ void SPSpiral::set_shape() {
/* Reset the shape's curve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
SPCurve * before = this->getCurveBeforeLPE();
- if (before || this->hasPathEffectRecursive()) {
+ bool haslpe = this->hasPathEffectOnClipOrMaskRecursive(this);
+ if (before || haslpe) {
if (c && before && before->get_pathvector() != c->get_pathvector()){
this->setCurveBeforeLPE(c);
sp_lpe_item_update_patheffect(this, true, false);
- } else {
+ } else if(haslpe) {
this->setCurveBeforeLPE(c);
+ } else {
+ //This happends on undo, fix bug:#1791784
+ this->setCurveInsync(c);
}
} else {
this->setCurveInsync(c);
diff --git a/src/object/sp-star.cpp b/src/object/sp-star.cpp
index fda39f4af..40d38d4a8 100644
--- a/src/object/sp-star.cpp
+++ b/src/object/sp-star.cpp
@@ -432,12 +432,16 @@ void SPStar::set_shape() {
/* Reset the shape's curve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
SPCurve * before = this->getCurveBeforeLPE();
- if (before || this->hasPathEffectRecursive()) {
+ bool haslpe = this->hasPathEffectOnClipOrMaskRecursive(this);
+ if (before || haslpe) {
if (c && before && before->get_pathvector() != c->get_pathvector()){
this->setCurveBeforeLPE(c);
sp_lpe_item_update_patheffect(this, true, false);
- } else {
+ } else if(haslpe) {
this->setCurveBeforeLPE(c);
+ } else {
+ //This happends on undo, fix bug:#1791784
+ this->setCurveInsync(c);
}
} else {
this->setCurveInsync(c);