Skip to content

Commit 0a8e87c

Browse files
authored
Update Slot.cpp
fixed slot intersectsSegment bug
1 parent ebd2f7e commit 0a8e87c

File tree

1 file changed

+6
-6
lines changed
  • DragonBones/src/dragonBones/armature

1 file changed

+6
-6
lines changed

DragonBones/src/dragonBones/armature/Slot.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -746,34 +746,34 @@ int Slot::intersectsSegment(
746746
{
747747
if (intersectionCount == 1 || intersectionCount == 2)
748748
{
749-
if (intersectionPointA == nullptr)
749+
if (intersectionPointA != nullptr)
750750
{
751751
globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA);
752-
if (intersectionPointB == nullptr)
752+
if (intersectionPointB != nullptr)
753753
{
754754
intersectionPointB->x = intersectionPointA->x;
755755
intersectionPointB->y = intersectionPointA->y;
756756
}
757757
}
758-
else if (intersectionPointB == nullptr)
758+
else if (intersectionPointB != nullptr)
759759
{
760760
globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB);
761761
}
762762
}
763763
else
764764
{
765-
if (intersectionPointA == nullptr)
765+
if (intersectionPointA != nullptr)
766766
{
767767
globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA);
768768
}
769769

770-
if (intersectionPointB == nullptr)
770+
if (intersectionPointB != nullptr)
771771
{
772772
globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB);
773773
}
774774
}
775775

776-
if (normalRadians == nullptr)
776+
if (normalRadians != nullptr)
777777
{
778778
globalTransformMatrix.transformPoint(cos(normalRadians->x), sin(normalRadians->x), _helpPoint, true);
779779
normalRadians->x = atan2(_helpPoint.y, _helpPoint.x);

0 commit comments

Comments
 (0)