I think I have an idea of where it is coming from. CCLayers have m_bIgnoreAnchorPointForPosition set to true. Then in CCNode::nodeToParentTransform, there’s:

```
// Translate values
float x = m_obPosition.x ;
float y = m_obPosition.y ;
if (m_bIgnoreAnchorPointForPosition)
{
x += m_obAnchorPointInPoints.x;
y += m_obAnchorPointInPoints.y;
}
// Rotation values
// Change rotation code to handle X and Y
// If we skew with the exact same value for both x and y then we're simply just rotating
float cx = 1, sx = 0, cy = 1, sy = 0;
if (m_fRotationX || m_fRotationY)
{
float radiansX = -CC_DEGREES_TO_RADIANS(m_fRotationX);
float radiansY = -CC_DEGREES_TO_RADIANS(m_fRotationY);
cx = cosf(radiansX);
sx = sinf(radiansX);
cy = cosf(radiansY);
sy = sinf(radiansY);
}
bool needsSkewMatrix = ( m_fSkewX || m_fSkewY );
// optimization:
// inline anchor point calculation if skew is not needed
// Adjusted transform calculation for rotational skew
if (! needsSkewMatrix && !m_obAnchorPointInPoints.equals(CCPointZero))
{
x += cy * -m_obAnchorPointInPoints.x * m_fScaleX + -sx * -m_obAnchorPointInPoints.y * m_fScaleY;
y += sy * -m_obAnchorPointInPoints.x * m_fScaleX + cx * -m_obAnchorPointInPoints.y * m_fScaleY;
}
```

At the top, we have:

```
if (m_bIgnoreAnchorPointForPosition)
{
x += m_obAnchorPointInPoints.x;
y += m_obAnchorPointInPoints.y;
}
```

but at the bottom, we have:

```
if (! needsSkewMatrix && !m_obAnchorPointInPoints.equals(CCPointZero))
{
x += cy * -m_obAnchorPointInPoints.x * m_fScaleX + -sx * -m_obAnchorPointInPoints.y * m_fScaleY;
y += sy * -m_obAnchorPointInPoints.x * m_fScaleX + cx * -m_obAnchorPointInPoints.y * m_fScaleY;
}
```

It seems to me that they are out of synch. The first part seems to be trying to cancel the second part by pre-adding the anchor values to x and y. However, in the second part, the actual value is multiplied by other factors such as scaling before being added.

For me, since the problem is because of scaling, in the top part when it tries to cancel the second part, I can just add the scaling to fix it. However, with rotations and when ScaleX != ScaleY, it’ll get more complicated.

Hopefully, this will help getting this issue addressed. I don’t have more time to look at it but I would be happy to submit a bug report if such a tool exists.