//
// CCScrollLayerExt::doConstraintContent from 0x579d2c to 0x579eb0 (388 bytes)
//
// 3 xrefs:
// > CCScrollLayerExt::constraintContent @ 0x579eb8
// > MPLobbyLayer::updateComments @ 0x9c9b6c
// > ??> @ 0x6e280
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void CCScrollLayerExt::doConstraintContent(CCScrollLayerExt *a1, bool a2)
{
_BOOL4 v2; // w21
float x; // s11
float y; // s9
float MinY; // s10
float MaxY; // s8
CCScrollLayerExtDelegate *m_delegate; // x0
CCScrollLayerExtDelegate *v9; // x0
cocos2d::CCMoveTo *v10; // x0
cocos2d::CCEaseInOut *v11; // x21
cocos2d::CCFiniteTimeAction *v12; // x0
CCContentLayer *m_contentLayer; // x19
cocos2d::CCAction *v14; // x0
cocos2d::CCPoint v15; // [xsp+50h] [xbp+50h] BYREF
v2 = a2;
x = a1->m_contentLayer->getPosition(a1->m_contentLayer)->x;
y = a1->m_contentLayer->getPosition(a1->m_contentLayer)->y;
MinY = CCScrollLayerExt::getMinY(a1);
MaxY = CCScrollLayerExt::getMaxY(a1);
if ( y <= MaxY )
{
if ( y >= MinY )
{
m_delegate = a1->m_delegate;
if ( m_delegate )
m_delegate->scrollViewDidEndMoving(m_delegate, a1);
return;
}
MaxY = MinY;
}
cocos2d::CCNode::stopAllActions(a1->m_contentLayer);
if ( v2 )
{
a1->m_contentLayer->setPosition_0(a1->m_contentLayer, x, MaxY);
CCScrollLayerExt::scrollingEnd(a1);
}
else
{
v9 = a1->m_delegate;
if ( v9 )
v9->scrllViewWillBeginDecelerating(v9, a1);
cocos2d::CCPoint::CCPoint(&v15, x, MaxY);
v10 = cocos2d::CCMoveTo::create(0.3, &v15);
v11 = cocos2d::CCEaseInOut::create(v10, 2.0);
v12 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, CCScrollLayerExt::scrollingEnd, 0);
m_contentLayer = a1->m_contentLayer;
v14 = (cocos2d::CCAction *)cocos2d::CCSequence::create((cocos2d::CCSequence *)v11, v12, 0);
cocos2d::CCNode::runAction(m_contentLayer, v14);
}
}