diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp
index 3f55d040bc426a0f806c2d0f37617da34c167395..904d0cb231a73536d34526fa7ae5d32e969d0f25 100644 (file)
--- a/src/tweak-context.cpp
+++ b/src/tweak-context.cpp
#include "path-chemistry.h"
#include "sp-gradient.h"
#include "sp-stop.h"
#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"
#include "sp-gradient-reference.h"
#include "sp-linear-gradient.h"
#include "sp-radial-gradient.h"
// Normalize pos to 0..1, taking into accound gradient spread:
double pos_e = pos;
// 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;
pos_e = 1;
- if (pos < 0)
+ }
+ if (pos < 0) {
pos_e = 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);
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 (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;
pos_e = 1 - pos_e;
+ }
}
}
}
}