I made CCRect's scalling method.

cocos2d::CCRect rtSetScale(const cocos2d::CCRect& t, float sc, CCPoint ap = ccp(0.5f, 0.5f))
{
CCRect ret = t;
CCPoint move = ccp(t.size.width * ap.x - t.size.width * sc * ap.x,
t.size.height * ap.y - t.size.height * sc * ap.y);
ret.origin = ret.origin + move;
ret.size = ret.size * sc;
return ret;
}

sample:
CCRect rt = CCRectMake(0, 0, 100, 100);
CCRect rt1 = rtSetScale(rt, 0.5f); // center, scale : 0.5f
CCLog(“f f f f”, rt1.origin.x, rt1.origin.y, rt1.size.width, rt1.size.height);
CCRect rt2 = rtSetScale(rt, 0.5f, ccp(0.25f,0.25f)); // anchor point, scale : 0.5f
CCLog(“f f f f”, rt2.origin.x, rt2.origin.y, rt2.size.width, rt2.size.height);
CCRect rt3 = rtSetScale(rt, 0.5f, ccp(1,1)); // anchor point, scale : 0.5f
CCLog(“f f f f”, rt3.origin.x, rt3.origin.y, rt3.size.width, rt3.size.height);
CCRect rt4 = rtSetScale(rt, 0.25f); // center, scale : 0.25f
CCLog(“f f f f”, rt4.origin.x, rt4.origin.y, rt4.size.width, rt4.size.height);

Cocos2d: 25.000000 25.000000 50.000000 50.000000
Cocos2d: 12.500000 12.500000 50.000000 50.000000
Cocos2d: 50.000000 50.000000 50.000000 50.000000
Cocos2d: 37.500000 37.500000 25.000000 25.000000

what do you think?