~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/tweak-context.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
#include "path-chemistry.h"
56
56
#include "sp-gradient.h"
57
57
#include "sp-stop.h"
58
 
#include "sp-stop-fns.h"
59
58
#include "sp-gradient-reference.h"
60
59
#include "sp-linear-gradient.h"
61
60
#include "sp-radial-gradient.h"
838
837
 
839
838
    // Normalize pos to 0..1, taking into accound gradient spread:
840
839
    double pos_e = pos;
841
 
    if (gradient->spread == SP_GRADIENT_SPREAD_PAD) {
842
 
        if (pos > 1)
 
840
    if (gradient->getSpread() == SP_GRADIENT_SPREAD_PAD) {
 
841
        if (pos > 1) {
843
842
            pos_e = 1;
844
 
        if (pos < 0)
 
843
        }
 
844
        if (pos < 0) {
845
845
            pos_e = 0;
846
 
    } else if (gradient->spread == SP_GRADIENT_SPREAD_REPEAT) {
847
 
        if (pos > 1 || pos < 0)
 
846
        }
 
847
    } else if (gradient->getSpread() == SP_GRADIENT_SPREAD_REPEAT) {
 
848
        if (pos > 1 || pos < 0) {
848
849
            pos_e = pos - floor(pos);
849
 
    } else if (gradient->spread == SP_GRADIENT_SPREAD_REFLECT) {
 
850
        }
 
851
    } else if (gradient->getSpread() == SP_GRADIENT_SPREAD_REFLECT) {
850
852
        if (pos > 1 || pos < 0) {
851
853
            bool odd = ((int)(floor(pos)) % 2 == 1);
852
854
            pos_e = pos - floor(pos);
853
 
            if (odd)
 
855
            if (odd) {
854
856
                pos_e = 1 - pos_e;
 
857
            }
855
858
        }
856
859
    }
857
860