diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-06-28 03:16:09 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-06-28 03:16:09 +0000 |
| commit | 7e8ffe9fb3b42470802ed080dc827fdda32165b3 (patch) | |
| tree | b299fd5c823e786eb2baf6c92c02c38592be0d97 /src/tweak-context.cpp | |
| parent | Implementing the "Convert" popup menu item for gradients/swatches. Part of bu... (diff) | |
| download | inkscape-7e8ffe9fb3b42470802ed080dc827fdda32165b3.tar.gz inkscape-7e8ffe9fb3b42470802ed080dc827fdda32165b3.zip | |
Partial C++-ification of SPGradient
(bzr r9542)
Diffstat (limited to 'src/tweak-context.cpp')
| -rw-r--r-- | src/tweak-context.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 13299b5a4..904d0cb23 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -837,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; + } } } |
