X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftweak-context.cpp;h=904d0cb231a73536d34526fa7ae5d32e969d0f25;hb=6a66fb22a9b064d49db980ce175f1858b8a9552a;hp=3f55d040bc426a0f806c2d0f37617da34c167395;hpb=f24714b30a73cad9fb6b5522e51bc1e50a55fc27;p=inkscape.git diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 3f55d040b..904d0cb23 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -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; + } } }