diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-01-12 23:25:39 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-01-12 23:25:39 +0000 |
| commit | 5eb9b4815a12cc0dafd07905f7715a7e15a92b41 (patch) | |
| tree | f39f5ae5a40012fa010402611d2b133553c22335 /src/2geom/basic-intersection.cpp | |
| parent | LPE: rename function getHelperPaths --> getCanvasIndicators (the function is ... (diff) | |
| download | inkscape-5eb9b4815a12cc0dafd07905f7715a7e15a92b41.tar.gz inkscape-5eb9b4815a12cc0dafd07905f7715a7e15a92b41.zip | |
update 2geom's copy to r2142
(bzr r12921)
Diffstat (limited to 'src/2geom/basic-intersection.cpp')
| -rw-r--r-- | src/2geom/basic-intersection.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/2geom/basic-intersection.cpp b/src/2geom/basic-intersection.cpp index 544bf0dd1..379ec597c 100644 --- a/src/2geom/basic-intersection.cpp +++ b/src/2geom/basic-intersection.cpp @@ -64,15 +64,13 @@ void find_intersections(std::vector< std::pair<double, double> > & xs, void split(vector<Point> const &p, double t, vector<Point> &left, vector<Point> &right) { const unsigned sz = p.size(); - - Geom::Point **Vtemp = new Geom::Point* [sz]; - - for (unsigned int i = 0; i < sz; ++i) { - Vtemp[i] = new Geom::Point[sz]; - } + //Geom::Point Vtemp[sz][sz]; + vector<vector<Point> > Vtemp(sz); + for ( size_t i = 0; i < sz; ++i ) + Vtemp[i].reserve(sz); /* Copy control points */ - std::copy(p.begin(), p.end(), Vtemp[0]); + std::copy(p.begin(), p.end(), Vtemp[0].begin()); /* Triangle computation */ for (unsigned i = 1; i < sz; i++) { @@ -87,11 +85,6 @@ void split(vector<Point> const &p, double t, left[j] = Vtemp[j][0]; for (unsigned j = 0; j < sz; j++) right[j] = Vtemp[sz-1-j][j]; - - for (unsigned int i = 0; i < sz; ++i) - delete[] Vtemp[i]; - - delete[] Vtemp; } |
