MCPcopy Create free account
hub / github.com/OpenBoardView/OpenBoardView / DrawSelectedPins

Method DrawSelectedPins

src/openboardview/BoardView.cpp:3142–3152  ·  view source on GitHub ↗

* TODO * EXPERIMENTAL, draw an area around selected pins */

Source from the content-addressed store, hash-verified

3140 * EXPERIMENTAL, draw an area around selected pins
3141 */
3142void BoardView::DrawSelectedPins(ImDrawList *draw) {
3143 std::vector<ImVec2> pl;
3144 if ((m_pinHighlighted.size()) < 3) return;
3145 for (auto &p : m_pinHighlighted) {
3146 pl.push_back(CoordToScreen(p->position.x, p->position.y));
3147 }
3148 std::vector<ImVec2> hull = VHConvexHull(pl);
3149 if (hull.size() > 3) {
3150 draw->AddConvexPolyFilled(hull.data(), hull.size(), 0x660000ff);
3151 }
3152}
3153
3154void BoardView::DrawBoard() {
3155 if (!m_file || !m_board) return;

Callers

nothing calls this directly

Calls 1

VHConvexHullFunction · 0.85

Tested by

no test coverage detected