MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / pointInRect

Method pointInRect

App/interaction/picking/PickingSystem.cpp:209–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209template <typename T> bool PickingSystem::pointInRect(const T& point, const T& start, const T& end) {
210 int minX = std::min(static_cast<int>(start.x), static_cast<int>(end.x));
211 int maxX = std::max(static_cast<int>(start.x), static_cast<int>(end.x));
212 int minY = std::min(static_cast<int>(start.y), static_cast<int>(end.y));
213 int maxY = std::max(static_cast<int>(start.y), static_cast<int>(end.y));
214 const int px = static_cast<int>(point.x);
215 const int py = static_cast<int>(point.y);
216 return (minX <= px && px <= maxX && minY <= py && py <= maxY);
217}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected