1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Update Areas.cpp

This commit is contained in:
Sandu Liviu Catalin 2021-08-18 22:19:04 +03:00
parent f23a8bc8f5
commit 1d2a78c91e

View File

@ -53,7 +53,7 @@ void Area::AddCircleEx(SQFloat cx, SQFloat cy, SQFloat cr, SQInteger num_segment
CheckLock();
// Get the current angle
#ifdef SQUSEDOUBLE
SQFloat theta = 2.0d * SQMOD_PI64 * static_cast< SQFloat >(i) / static_cast< SQFloat >(num_segments);
SQFloat theta = 2.0 * SQMOD_PI64 * static_cast< SQFloat >(i) / static_cast< SQFloat >(num_segments);
#else
SQFloat theta = 2.0f * SQMOD_PI * static_cast< SQFloat >(i) / static_cast< SQFloat >(num_segments);
#endif // SQUSEDOUBLE
@ -62,9 +62,9 @@ void Area::AddCircleEx(SQFloat cx, SQFloat cy, SQFloat cr, SQInteger num_segment
// Calculate the y component
SQFloat y = (cr * std::sin(theta)) + cy;
// Insert the point into the list
mPoints.emplace_back(x, y);
mPoints.emplace_back(static_cast< Vector2::Value >(x), static_cast< Vector2::Value >(y));
// Update the bounding box
Expand(x, y);
Expand(static_cast< Vector2::Value >(x), static_cast< Vector2::Value >(y));
}
}