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

Method hitTest

core/ui/UISlider.cpp:492–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492bool Slider::hitTest(const ax::Vec2& pt, const Camera* camera, Vec3* /*p*/) const
493{
494 Rect rect;
495 rect.size = _slidBallNormalRenderer->getContentSize();
496 auto w2l = _slidBallNormalRenderer->getWorldToNodeTransform();
497
498 Rect sliderBarRect;
499 sliderBarRect.size = this->_barRenderer->getContentSize();
500 auto barW2l = this->_barRenderer->getWorldToNodeTransform();
501 return isScreenPointInRect(pt, camera, w2l, rect, nullptr) ||
502 isScreenPointInRect(pt, camera, barW2l, sliderBarRect, nullptr);
503}
504
505bool Slider::onTouchBegan(Touch* touch, Event* unusedEvent)
506{

Callers

nothing calls this directly

Calls 3

isScreenPointInRectFunction · 0.85
getContentSizeMethod · 0.45

Tested by

no test coverage detected