CCRect containsPoint 问题

void Preview::test(CCObject * pSender,TouchEventType type)
{
if(type == TOUCH_EVENT_BEGAN)
{
Widget * pWidgetTouchPoint = (Widget *)pSender;
CCPoint touchPoint = pWidgetTouchPoint->getTouchStartPos();
CCLog(“x = %f y = %f”,touchPoint.x,touchPoint.y);
int tag;
//循环查找点击到的精灵
for (tag = 0;tag< card_count;tag++)
{
UIImageView * Card_HeadImage= (UIImageView *)m_pPanelCell->getChildByTag(tag);
CCRect rc = Card_HeadImage->boundingBox();
CCLog(“rc-x = %f rc-y = %f”,rc.origin.x,rc.origin.y);
if (rc.containsPoint(touchPoint))
{

无法进入IF方法中,rc.containsPoint(touchPoint)对吗?
点击LOG:
x = 94.251785 y = 651.654785
rc-x = 80.000000 rc-y = 648.000000
rc-x = 201.600006 rc-y = 648.000000
rc-x = 323.200012 rc-y = 648.000000
rc-x = 444.799988 rc-y = 648.000000
rc-x = 566.400024 rc-y = 648.000000
rc-x = 80.000000 rc-y = 530.400024
rc-x = 201.600006 rc-y = 530.400024
rc-x = 323.200012 rc-y = 530.400024
rc-x = 444.799988 rc-y = 530.400024

首先UIImageView * Card_HeadImage= (UIImageView *)m_pPanelCell->getChildByTag(tag);
这句话可能会有问题,你需要保证这个tag是按照序123…顺序创建出来的。

是的,能够成功获取到。
Card_HeadImage 已经没有问题了

UIImageView * Card_HeadImage= (UIImageView *)m_pPanelCell->getChildByTag(tag);
CCRect rc = Card_HeadImage->boundingBox();
CCLog(“rc-x = %f rc-y = %f”,rc.size.width,rc.size.height);
LOG:
x = 197.117966 y = 535.917664
rc-x = 0.000000 rc-y = 0.000000
rc-x = 0.000000 rc-y = 0.000000
rc-x = 0.000000 rc-y = 0.000000
rc-x = 0.000000 rc-y = 0.000000

CCRECT有问题
CCRect rc = Card_HeadImage->boundingBox();
CCRect newRc = CCRectMake(rc.origin.x, rc.origin.y, Card_HeadImage->getContentSize().width, Card_HeadImage->getContentSize().height);
用NEWRC 可解决