-
Notifications
You must be signed in to change notification settings - Fork 236
Description
DragonBonesCPP/DragonBones/src/dragonBones/armature/Slot.cpp - line 780
if (intersectionCount > 0)
{
if (intersectionCount == 1 || intersectionCount == 2)
{
if (intersectionPointA == nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA);
if (intersectionPointB == nullptr)
{
intersectionPointB->x = intersectionPointA->x;
intersectionPointB->y = intersectionPointA->y;
}
}
else if (intersectionPointB == nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB);
}
}
else
{
if (intersectionPointA == nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA);
}
if (intersectionPointB == nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB);
}
}
if (normalRadians == nullptr)
{
globalTransformMatrix.transformPoint(cos(normalRadians->x), sin(normalRadians->x), _helpPoint, true);
normalRadians->x = atan2(_helpPoint.y, _helpPoint.x);
globalTransformMatrix.transformPoint(cos(normalRadians->y), sin(normalRadians->y), _helpPoint, true);
normalRadians->y = atan2(_helpPoint.y, _helpPoint.x);
}
-fix code
if (intersectionCount > 0)
{
if (intersectionCount == 1 || intersectionCount == 2)
{
if (intersectionPointA != nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA);
if (intersectionPointB != nullptr)
{
intersectionPointB->x = intersectionPointA->x;
intersectionPointB->y = intersectionPointA->y;
}
}
else if (intersectionPointB != nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB);
}
}
else
{
if (intersectionPointA != nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA);
}
if (intersectionPointB != nullptr)
{
globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB);
}
}
if (normalRadians != nullptr)
{
globalTransformMatrix.transformPoint(cos(normalRadians->x), sin(normalRadians->x), _helpPoint, true);
normalRadians->x = atan2(_helpPoint.y, _helpPoint.x);
globalTransformMatrix.transformPoint(cos(normalRadians->y), sin(normalRadians->y), _helpPoint, true);
normalRadians->y = atan2(_helpPoint.y, _helpPoint.x);
}