Skip to content

Commit

Permalink
Update DrawNode.cpp part of axmolengine#2140
Browse files Browse the repository at this point in the history
  • Loading branch information
aismann authored Sep 14, 2024
1 parent 117c4e6 commit fdae1b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/2d/DrawNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,9 @@ void DrawNode::_drawCircle(const Vec2& center,
{
const float coef = 2.0f * (float)M_PI / segments;

Vec2* _vertices = new Vec2[segments + 2];
Vec2* _vertices = new Vec2[segments + 3];

for (unsigned int i = 0; i < segments; i++)
for (unsigned int i = 0; i < segments + 1; i++)
{
float rads = i * coef;
float j = radius * cosf(rads + angle) * scaleX + center.x;
Expand All @@ -1256,7 +1256,7 @@ void DrawNode::_drawCircle(const Vec2& center,
_vertices[i].x = j;
_vertices[i].y = k;
}
_vertices[segments] = _vertices[0];
_vertices[++segments] = _vertices[0];

if (solid)
{
Expand Down

0 comments on commit fdae1b7

Please sign in to comment.