mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -05:00
fix scrollbar touch
This commit is contained in:
parent
53fa4d3185
commit
34e80c1ea8
1 changed files with 5 additions and 2 deletions
|
@ -5,8 +5,11 @@ using namespace geode::prelude;
|
|||
|
||||
bool Scrollbar::ccTouchBegan(CCTouch* touch, CCEvent* event) {
|
||||
// hitbox
|
||||
auto rect = this->boundingBox();
|
||||
if (!m_target || !rect.containsPoint(touch->getLocation())) return false;
|
||||
auto const size = this->getContentSize();
|
||||
auto const pos = this->convertToNodeSpace(touch->getLocation());
|
||||
auto const rect = CCRect{0, 0, size.width, size.height};
|
||||
|
||||
if (!m_target || !rect.containsPoint(pos)) return false;
|
||||
|
||||
// trigger scrollbar thumb move
|
||||
this->ccTouchMoved(touch, event);
|
||||
|
|
Loading…
Reference in a new issue