More precise testing of edges on mouse hit - without this patch, the selected objects in dense regions are not at the mouse pointer's tip, but somewhat away

This commit is contained in:
Matthias Koefferlein 2023-05-11 19:03:41 +02:00
parent 1422dfb93d
commit 424c039b7e
1 changed files with 5 additions and 2 deletions

View File

@ -137,8 +137,11 @@ Finder::test_edge (const db::ICplxTrans &trans, const db::Edge &edg, double &dis
double d1 = p1.double_distance (m_region.center ());
double d2 = p2.double_distance (m_region.center ());
// snap to the point - nothing can get closer
distance = 0.0;
double d = std::min (d1, d2);
if (! match || d < distance) {
distance = d;
}
if (d1 < d2) {
ret = 1;
} else {