File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -444,7 +444,10 @@ class ContourFinder
444444 void
445445 find_closest_exact (const db::DPoint &p, const db::DEdge &e)
446446 {
447- if (! m_any_exact || m_original.distance (p) < m_original.distance (m_closest_exact)) {
447+ bool was_vertex = m_edge1_exact.is_degenerate () && m_edge2_exact.is_degenerate ();
448+ bool is_vertex = e.is_degenerate ();
449+
450+ if (! m_any_exact || (! (was_vertex && ! is_vertex) && (m_original.distance (p) < m_original.distance (m_closest_exact) || (! was_vertex && is_vertex)))) {
448451
449452 if (m_directed) {
450453 for (std::vector<db::DEdge>::const_iterator cl = m_cutlines.begin (); cl != m_cutlines.end (); ++cl) {
@@ -465,7 +468,10 @@ class ContourFinder
465468 void
466469 find_closest (const db::DPoint &p, const db::DEdge &e)
467470 {
468- if (! m_any || m_original.distance (p) < m_original.distance (m_closest)) {
471+ bool was_vertex = m_edge1.is_degenerate () && m_edge2.is_degenerate ();
472+ bool is_vertex = e.is_degenerate ();
473+
474+ if (! m_any || (! (was_vertex && ! is_vertex) && (m_original.distance (p) < m_original.distance (m_closest) || (! was_vertex && is_vertex)))) {
469475
470476 if (m_directed) {
471477 for (std::vector<db::DEdge>::const_iterator cl = m_cutlines.begin (); cl != m_cutlines.end (); ++cl) {
You can’t perform that action at this time.
0 commit comments