Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Köfferlein f80c51bfd2
Merge 4ee73b5f86 into 8b010d61d2 2025-10-27 08:05:52 +01:00
1 changed files with 5 additions and 25 deletions

View File

@ -613,7 +613,7 @@ private:
if (shape->is_polygon ()) {
for (db::Shape::polygon_edge_iterator e = shape->begin_edge (); ! e.at_end (); ++e) {
test_edge_with_center (t * *e);
test_edge (t * *e);
}
} else if (shape->is_path ()) {
@ -649,20 +649,16 @@ private:
}
test_edge (db::DEdge (*p, pts [0]));
}
} else if (shape->is_box ()) {
const db::Box &box = shape->box ();
test_edge_with_center (t * db::Edge (box.p1 (), db::Point (box.left (), box.top ())));
test_edge_with_center (t * db::Edge (db::Point (box.left (), box.top ()), box.p2 ()));
test_edge_with_center (t * db::Edge (box.p2 (), db::Point (box.right (), box.bottom ())));
test_edge_with_center (t * db::Edge (db::Point (box.right (), box.bottom ()), box.p1 ()));
// test for box center
test_edge (t * db::Edge (box.center (), box.center ()));
test_edge (t * db::Edge (box.p1 (), db::Point (box.left (), box.top ())));
test_edge (t * db::Edge (db::Point (box.left (), box.top ()), box.p2 ()));
test_edge (t * db::Edge (box.p2 (), db::Point (box.right (), box.bottom ())));
test_edge (t * db::Edge (db::Point (box.right (), box.bottom ()), box.p1 ()));
} else if (shape->is_point ()) {
@ -701,22 +697,6 @@ private:
}
void
test_edge_with_center (const db::DEdge &edg)
{
if (m_with_vertex && ! edg.is_degenerate ()) {
db::DPoint c = edg.p1 () + (edg.p2 () - edg.p1 ()) * 0.5;
if (m_region.contains (c)) {
closest (c);
}
}
test_edge (edg);
}
void
test_edge (const db::DEdge &edg)
{