2dx关于tiledmap镜头跟随的问题,谁能帮帮忙?

用以下的代码,在map原始大小时可以正常的跟随角色移动,但是使用setScale(2.0f)把地图放大2倍后镜头就错乱了无法用了,我把地图的大小也*2也不管用,谁能帮忙看看怎么解决么?以下是代码

void HelloWorld::setViewpointCenter( Vec2 _pos )
{
//获取屏幕尺寸
auto screenSize = Director::getInstance()->getWinSize();
//计算Tilemap的宽高,单位是像素
//auto mapSizeInPixel = Size((m_map->getMapSize().widthm_map->getTileSize().width), (m_map->getMapSize().heightm_map->getTileSize().height));
auto mapSizeInPixel = m_map->getContentSize();

//取勇士当前x坐标和屏幕中点x的最大值,如果勇士的x值较大,则会滚动  
float x = MAX( _pos.x, screenSize.width / 2.0f);
float y = MAX( _pos.y, screenSize.height / 2.0f);

//地图总宽度大于屏幕宽度的时候才有可能滚动
if (mapSizeInPixel.width>screenSize.width)
{
    x = MIN(x, mapSizeInPixel.width - screenSize.width / 2.0f);
}
if (mapSizeInPixel.height>screenSize.height)
{
    y = MIN(y, mapSizeInPixel.height - screenSize.height / 2.0f);
}

//勇士的实际位置  
auto heroPosition = Vec2(x, y);
//屏幕中点位置  
auto screenCenter = Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f);
//计算勇士实际位置和中点位置的距离  
auto scrollPosition = ccpSub(screenCenter, heroPosition);
//将场景移动到相应位置  
m_map->setPosition(scrollPosition);

}