Эх сурвалжийг харах

[cocos2d-objc] Fixed calculation of bounding box.

badlogic 6 жил өмнө
parent
commit
45b8125a8e

+ 2 - 2
spine-cocos2d-objc/src/spine/SkeletonRenderer.m

@@ -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);
 			}