1009 Vertex closest; |
1009 Vertex closest; |
1010 bool valid = false; |
1010 bool valid = false; |
1011 |
1011 |
1012 QPoint curspos = coordconv3_2 (m_hoverpos); |
1012 QPoint curspos = coordconv3_2 (m_hoverpos); |
1013 |
1013 |
1014 for (const Vertex& pos3d: m_knownVerts) |
1014 for (auto it = document()->vertices().begin(); it != document()->vertices().end(); ++it) |
1015 { |
1015 { |
1016 QPoint pos2d = coordconv3_2 (pos3d); |
1016 QPoint pos2d = coordconv3_2 (it.key()); |
1017 |
1017 |
1018 // Measure squared distance |
1018 // Measure squared distance |
1019 const double dx = abs (pos2d.x() - curspos.x()), |
1019 const double dx = abs (pos2d.x() - curspos.x()), |
1020 dy = abs (pos2d.y() - curspos.y()), |
1020 dy = abs (pos2d.y() - curspos.y()), |
1021 distsq = (dx * dx) + (dy * dy); |
1021 distsq = (dx * dx) + (dy * dy); |