MCPcopy Create free account
hub / github.com/axmolengine/axmol / isNodeVisible

Method isNodeVisible

extensions/GUI/src/GUI/ScrollView/ScrollView.cpp:144–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144bool ScrollView::isNodeVisible(Node* node)
145{
146 const Vec2 offset = this->getContentOffset();
147 const Size size = this->getViewSize();
148 const float scale = this->getZoomScale();
149
150 Rect viewRect;
151
152 viewRect = Rect(-offset.x / scale, -offset.y / scale, size.width / scale, size.height / scale);
153
154 return viewRect.intersectsRect(node->getBoundingBox());
155}
156
157void ScrollView::pause(Object* /*sender*/)
158{

Calls 4

getContentOffsetMethod · 0.95
getZoomScaleMethod · 0.95
RectFunction · 0.50
getBoundingBoxMethod · 0.45

Tested by

no test coverage detected