//
// cocos2d::extension::CCScrollView::getViewRect from 0x5a8b4c to 0x5a8c28 (220 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCScrollView::beforeDraw @ 0x5a8c5e
// > cocos2d::extension::CCScrollView::ccTouchBegan @ 0x5a8e5e
// > cocos2d::extension::CCScrollView::ccTouchMoved @ 0x5a904c
//
// 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
//
cocos2d::CCRect *cocos2d::extension::CCScrollView::getViewRect(
cocos2d::CCRect *__return_ptr retstr,
cocos2d::extension::CCScrollView *a2)
{
float x; // s15
float v5; // s17
int v6; // r0
cocos2d::CCNode *m_pParent; // r4
float v8; // s16
float width; // s14
float height; // s13
float v11; // s15
float v12; // s15
cocos2d::CCPoint v14; // [sp+Ch] [bp-10h] BYREF
cocos2d::CCNode::convertToWorldSpace(&v14, a2, &stru_AC8268);
v5 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::extension::CCScrollView *))a2->getScaleX)(a2));
v6 = ((int (__fastcall *)(cocos2d::extension::CCScrollView *))a2->getScaleY)(a2);
m_pParent = a2->m_pParent;
v8 = *(float *)&v6;
while ( m_pParent )
{
v5 = v5 * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCNode *))m_pParent->getScaleX)(m_pParent));
x = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCNode *))m_pParent->getScaleY)(m_pParent));
v8 = v8 * x;
m_pParent = m_pParent->getParent(m_pParent);
}
width = a2->m_tViewSize.width;
if ( v5 < 0.0 )
x = v14.x;
height = a2->m_tViewSize.height;
if ( v5 < 0.0 )
{
v11 = x + (float)(v5 * width);
v5 = -v5;
v14.x = v11;
}
if ( v8 < 0.0 )
{
v12 = v14.y + (float)(v8 * height);
v8 = -v8;
v14.y = v12;
}
cocos2d::CCRect::CCRect(retstr, v14.x, v14.y, v5 * width, v8 * height);
return retstr;
}