[cocos2d-objc] Fixed calculation of bounding box.

This commit is contained in:
badlogic 2019-07-26 11:36:00 +02:00
parent 3e84da4d63
commit 45b8125a8e

View File

@ -280,8 +280,8 @@ static bool handlerQueued = false;
minY = MIN(vertices[i+1], minY);
maxY = MAX(vertices[i+1], maxY);
}
GLKVector2 center = GLKVector2Make((maxX - minX) / 2, (maxY - minY) / 2);
GLKVector2 extents = GLKVector2Make((maxX - minX), (maxY - minY));
GLKVector2 center = GLKVector2Make(minX + (maxX - minX) / 2, minY + (maxY - minY) / 2);
GLKVector2 extents = GLKVector2Make((maxX - minX) / 2, (maxY - minY) / 2);
isVisible = CCRenderCheckVisbility(transform, center, extents);
}