MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / isUnder

Method isUnder

gui/qt/keypad/arrowkey.cpp:41–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool ArrowKey::isUnder(const QPainterPath &area) const {
42 QPainterPath key;
43 key.addEllipse(mOuter);
44 if (!key.intersects(area) || !area.elementCount()) {
45 return false;
46 }
47 QPointF center{area.isEmpty() ? area.elementAt(0) : area.controlPointRect().center()};
48 QVector2D offset{center - mOuter.center()};
49 return (static_cast<int>((2*M_2_PI * std::atan2(offset.y(), offset.x()) + 9.5) + mOffset) & 7) < 3;
50}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected