Update JGL.cpp
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 1m47s

Fix memory error
This commit is contained in:
2024-10-09 22:54:41 -04:00
parent 97573e28a9
commit 4484fd482f

View File

@@ -572,7 +572,7 @@ namespace JGL {
for (angle = 0.0f; angle < (2.f * Math::Pi); angle += step) {
x = radius * std::sin(angle) + center.x;
y = radius * std::cos(angle) + center.y;
if (i <= subdivisions)
if (i < subdivisions)
vertices[i] = {x, y};
else
vertices.emplace_back(x, y);
@@ -601,7 +601,7 @@ namespace JGL {
for (angle = 0.0f; angle < (2.f * Math::Pi); angle += step) {
x = radius * std::sin(angle) + center.x;
y = radius * std::cos(angle) + center.y;
if (i <= subdivisions)
if (i < subdivisions)
vertices[i] = {x, y};
else
vertices.emplace_back(x, y);