Fix a bug in examples/shapes/shapes_following_eyes (#3710)

This commit is contained in:
Hongyu Ouyang 2024-01-06 02:32:10 -08:00 committed by GitHub
parent a4dc325a0c
commit 721e273547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ int main(void)
irisRightPosition = GetMousePosition();
// Check not inside the left eye sclera
if (!CheckCollisionPointCircle(irisLeftPosition, scleraLeftPosition, scleraRadius - 20))
if (!CheckCollisionPointCircle(irisLeftPosition, scleraLeftPosition, scleraRadius - irisRadius))
{
dx = irisLeftPosition.x - scleraLeftPosition.x;
dy = irisLeftPosition.y - scleraLeftPosition.y;
@ -65,7 +65,7 @@ int main(void)
}
// Check not inside the right eye sclera
if (!CheckCollisionPointCircle(irisRightPosition, scleraRightPosition, scleraRadius - 20))
if (!CheckCollisionPointCircle(irisRightPosition, scleraRightPosition, scleraRadius - irisRadius))
{
dx = irisRightPosition.x - scleraRightPosition.x;
dy = irisRightPosition.y - scleraRightPosition.y;