Code

When reworking Preben's patch I forgot a few things (oops).
authorjaspervdg <jaspervdg@users.sourceforge.net>
Tue, 21 Apr 2009 14:25:51 +0000 (14:25 +0000)
committerjaspervdg <jaspervdg@users.sourceforge.net>
Tue, 21 Apr 2009 14:25:51 +0000 (14:25 +0000)
src/filters/convolvematrix.cpp

index a5a40811c6d14df094703618d0c06bd65f5463cc..5cda2a1391f96a7317c69ac00dfe53db6b112404 100644 (file)
@@ -191,8 +191,10 @@ sp_feConvolveMatrix_set(SPObject *object, unsigned int key, gchar const *value)
                 read_num = helperfns_read_number(value);
                 if (read_num == 0) {
                     // This should actually be an error, but given our UI it is more useful to simply set divisor to the default.
-                    for (unsigned int i = 0; i< feConvolveMatrix->kernelMatrix.size(); i++)
-                        read_num += feConvolveMatrix->kernelMatrix[i];
+                    if (feConvolveMatrix->kernelMatrixIsSet) {
+                        for (unsigned int i = 0; i< feConvolveMatrix->kernelMatrix.size(); i++)
+                            read_num += feConvolveMatrix->kernelMatrix[i];
+                    }
                     if (read_num == 0) read_num = 1;
                     if (feConvolveMatrix->divisorIsSet || feConvolveMatrix->divisor!=read_num) {
                         feConvolveMatrix->divisorIsSet = false;
@@ -202,6 +204,7 @@ sp_feConvolveMatrix_set(SPObject *object, unsigned int key, gchar const *value)
                 } else if (!feConvolveMatrix->divisorIsSet || feConvolveMatrix->divisor!=read_num) {
                     feConvolveMatrix->divisorIsSet = true;
                     feConvolveMatrix->divisor = read_num;
+                    object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG);
                 }
             }
             break;