Code

Extensions. Fix for Bug #652943 (Aborted output extensions create an empty file).
[inkscape.git] / src / tweak-context.cpp
index 3f55d040bc426a0f806c2d0f37617da34c167395..904d0cb231a73536d34526fa7ae5d32e969d0f25 100644 (file)
@@ -55,7 +55,6 @@
 #include "path-chemistry.h"
 #include "sp-gradient.h"
 #include "sp-stop.h"
-#include "sp-stop-fns.h"
 #include "sp-gradient-reference.h"
 #include "sp-linear-gradient.h"
 #include "sp-radial-gradient.h"
@@ -838,20 +837,24 @@ tweak_colors_in_gradient (SPItem *item, bool fill_or_stroke,
 
     // Normalize pos to 0..1, taking into accound gradient spread:
     double pos_e = pos;
-    if (gradient->spread == SP_GRADIENT_SPREAD_PAD) {
-        if (pos > 1)
+    if (gradient->getSpread() == SP_GRADIENT_SPREAD_PAD) {
+        if (pos > 1) {
             pos_e = 1;
-        if (pos < 0)
+        }
+        if (pos < 0) {
             pos_e = 0;
-    } else if (gradient->spread == SP_GRADIENT_SPREAD_REPEAT) {
-        if (pos > 1 || pos < 0)
+        }
+    } else if (gradient->getSpread() == SP_GRADIENT_SPREAD_REPEAT) {
+        if (pos > 1 || pos < 0) {
             pos_e = pos - floor(pos);
-    } else if (gradient->spread == SP_GRADIENT_SPREAD_REFLECT) {
+        }
+    } else if (gradient->getSpread() == SP_GRADIENT_SPREAD_REFLECT) {
         if (pos > 1 || pos < 0) {
             bool odd = ((int)(floor(pos)) % 2 == 1);
             pos_e = pos - floor(pos);
-            if (odd)
+            if (odd) {
                 pos_e = 1 - pos_e;
+            }
         }
     }