diff options
| author | Sebastian Wüst <sebi@timewaster.de> | 2013-10-28 17:23:42 +0000 |
|---|---|---|
| committer | Sebastian Wüst <sebi@timewaster.de> | 2013-10-28 17:23:42 +0000 |
| commit | c6ad2a34d38795059888d3c900dbf1047bfd5fdd (patch) | |
| tree | 88de58a63003bd2ea6edda9c895d3c0466a38e6b /src/conn-avoid-ref.cpp | |
| parent | text change (diff) | |
| parent | Fix for bug #1156394 (OCAL dialog: Close button in German localization contai... (diff) | |
| download | inkscape-c6ad2a34d38795059888d3c900dbf1047bfd5fdd.tar.gz inkscape-c6ad2a34d38795059888d3c900dbf1047bfd5fdd.zip | |
mrege from trunk
(bzr r12417.1.31)
Diffstat (limited to 'src/conn-avoid-ref.cpp')
| -rw-r--r-- | src/conn-avoid-ref.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index c0d05e3c4..cb72f65dc 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -303,23 +303,29 @@ static Avoid::Polygon avoid_item_poly(SPItem const *item) Geom::Line parallel_hull_edge; parallel_hull_edge.setOrigin(hull_edge.origin()+hull_edge.versor().ccw()*spacing); parallel_hull_edge.setVersor(hull_edge.versor()); - + // determine the intersection point - - Geom::OptCrossing int_pt = Geom::intersection(parallel_hull_edge, prev_parallel_hull_edge); - if (int_pt) - { - Avoid::Point avoid_pt((parallel_hull_edge.origin()+parallel_hull_edge.versor()*int_pt->ta)[Geom::X], - (parallel_hull_edge.origin()+parallel_hull_edge.versor()*int_pt->ta)[Geom::Y]); - poly.ps.push_back(avoid_pt); + try { + Geom::OptCrossing int_pt = Geom::intersection(parallel_hull_edge, prev_parallel_hull_edge); + if (int_pt) + { + Avoid::Point avoid_pt((parallel_hull_edge.origin()+parallel_hull_edge.versor()*int_pt->ta)[Geom::X], + (parallel_hull_edge.origin()+parallel_hull_edge.versor()*int_pt->ta)[Geom::Y]); + poly.ps.push_back(avoid_pt); + } + else + { + // something went wrong... + std::cout<<"conn-avoid-ref.cpp: avoid_item_poly: Geom:intersection failed."<<std::endl; + } } - else - { - // something went wrong... - std::cout<<"conn-avoid-ref.cpp: avoid_item_poly: Geom:intersection failed."<<std::endl; + catch (Geom::InfiniteSolutions const &e) { + // the parallel_hull_edge and prev_parallel_hull_edge lie on top of each other, hence infinite crossings + g_message("conn-avoid-ref.cpp: trying to get crossings of identical lines"); } prev_parallel_hull_edge = parallel_hull_edge; } + return poly; } |
