~ubuntu-branches/ubuntu/natty/inkscape/natty

« back to all changes in this revision

Viewing changes to src/live_effects/lpe-knot.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:
15
15
#include "live_effects/lpe-knot.h"
16
16
#include "svg/svg.h"
17
17
#include "style.h"
 
18
#include "knot-holder-entity.h"
18
19
 
19
20
#include <2geom/sbasis-to-bezier.h>
20
21
#include <2geom/sbasis.h>
55
56
static
56
57
std::vector<Geom::Interval> complementOf(Geom::Interval I, std::vector<Geom::Interval> domain){
57
58
    std::vector<Geom::Interval> ret;
58
 
    double min = domain.front().min();
59
 
    double max = domain.back().max();
60
 
    Geom::Interval I1 = Geom::Interval(min,I.min());
61
 
    Geom::Interval I2 = Geom::Interval(I.max(),max);
 
59
    if (!domain.empty()) {
 
60
        double min = domain.front().min();
 
61
        double max = domain.back().max();
 
62
        Geom::Interval I1 = Geom::Interval(min,I.min());
 
63
        Geom::Interval I2 = Geom::Interval(I.max(),max);
62
64
 
63
 
    for (unsigned i = 0; i<domain.size(); i++){
64
 
        boost::optional<Geom::Interval> I1i = intersect(domain.at(i),I1);
65
 
        if (I1i && !I1i->isSingular()) ret.push_back(I1i.get());
66
 
        boost::optional<Geom::Interval> I2i = intersect(domain.at(i),I2);
67
 
        if (I2i && !I2i->isSingular()) ret.push_back(I2i.get());
68
 
    }    
 
65
        for (unsigned i = 0; i<domain.size(); i++){
 
66
            boost::optional<Geom::Interval> I1i = intersect(domain.at(i),I1);
 
67
            if (I1i && !I1i->isSingular()) ret.push_back(I1i.get());
 
68
            boost::optional<Geom::Interval> I2i = intersect(domain.at(i),I2);
 
69
            if (I2i && !I2i->isSingular()) ret.push_back(I2i.get());
 
70
        }
 
71
    }
69
72
    return ret;
70
73
}
71
74