diff options
Diffstat (limited to 'src/2geom/crossing.cpp')
| -rw-r--r-- | src/2geom/crossing.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/2geom/crossing.cpp b/src/2geom/crossing.cpp index d717a4ed5..13affa8e9 100644 --- a/src/2geom/crossing.cpp +++ b/src/2geom/crossing.cpp @@ -113,6 +113,18 @@ CrossingGraph create_crossing_graph(std::vector<Path> const &p, Crossings const */ //} +// provide specific method for Paths because paths can be closed or open. Path::size() is named somewhat wrong... +std::vector<Rect> bounds(Path const &a) { + std::vector<Rect> rs; + for (unsigned i = 0; i < a.size_default(); i++) { + OptRect bb = a[i].boundsFast(); + if (bb) { + rs.push_back(*bb); + } + } + return rs; +} + void merge_crossings(Crossings &a, Crossings &b, unsigned i) { Crossings n; sort_crossings(b, i); @@ -200,4 +212,4 @@ void clean(Crossings &/*cr_a*/, Crossings &/*cr_b*/) { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
