tenho seguinte código c++ imgui

void RenderHexagonGraph(int str, int agi, int vit, int inte, int dex, int luk)
{
    // Window position and size
    ImVec2 window_pos = ImGui::GetWindowPos();
    ImVec2 window_size = ImGui::GetWindowSize();

    // Center of the graph
    ImVec2 center = ImVec2(window_pos.x + window_size.x * 0.5f, window_pos.y + window_size.y * 0.5f);

    // Maximum value and radius
    const float max_value = 150.0f;
    const float max_radius = 125.0f;

    // Colors for the background hexagons
    const ImVec4 colors[4] = {
        Ragnarok::getInstance().HexToImVec4(0x6A8EDC),
        Ragnarok::getInstance().HexToImVec4(0x8CBEF5),
        Ragnarok::getInstance().HexToImVec4(0xA9D1FF),
        Ragnarok::getInstance().HexToImVec4(0xCDE3FE)
    };

    // Radii for the background hexagons
    const float radii[4] = {
        max_radius * 0.25f,
        max_radius * 0.5f,
        max_radius * 0.75f,
        max_radius      // Largest hexagon
    };

    // Border thicknesses
    const float border_thickness[4] = { 1.0f, 1.0f, 1.0f, 3.0f };
    const ImU32 border_color = ImGui::ColorConvertFloat4ToU32(Ragnarok::getInstance().HexToImVec4(0x0F0F0F));

    ImDrawList* draw_list = ImGui::GetWindowDrawList();

    // Rotation angle to align "STR" at the top
    const float rotation_angle = -IM_PI / 2.0f;

    // Draw background hexagons
    for (int i = 3; i >= 0; --i)
    {
        DrawHexagonWithAttributes(center, radii[i], ImGui::ColorConvertFloat4ToU32(colors[i]), border_color, border_thickness[i]);
    }

    // Draw lines from center to vertices of the largest hexagon
    for (int i = 0; i < 6; ++i)
    {
        float angle = IM_PI / 3.0f * i + rotation_angle;
        ImVec2 outer_point = ImVec2(center.x + cosf(angle) * max_radius, center.y + sinf(angle) * max_radius);
        draw_list->AddLine(center, outer_point, border_color, 1.0f);
    }

    // Variables and their labels
    float variable_values[6] = { str, agi, vit, inte, dex, luk };
    const char* labels[6] = { "STR", "AGI", "VIT", "INT", "DEX", "LUK" };

    // Cálculo dos pontos dos atributos
    ImVec2 attribute_points[6];
    for (int j = 0; j < 6; ++j)
    {
        float fraction = variable_values[j] / max_value;
        fraction = ImClamp(fraction, 0.0f, 1.0f);
        float variable_radius = fraction * max_radius;
        float angle = IM_PI / 3.0f * j + rotation_angle;
        attribute_points[j] = ImVec2(center.x + cosf(angle) * variable_radius, center.y + sinf(angle) * variable_radius);
    }

    ImU32 attribute_fill_color = ImGui::ColorConvertFloat4ToU32(ImVec4(1.0f, 0.0f, 0.0f, 0.7f)); // Vermelho com 50% de opacidade
    ImU32 attribute_line_color = ImGui::ColorConvertFloat4ToU32(ImVec4(1.0f, 0.0f, 0.0f, 1.0f));  // Vermelho sólido

    for (int i = 0; i < 6; ++i)
    {
        int next_i = (i + 1) % 6;

        ImVec2 current_point = attribute_points[i];
        ImVec2 next_point = attribute_points[next_i];

        float current_value = variable_values[i];
        float next_value = variable_values[next_i];

        // Se ambos os valores forem zero, não desenhar o triângulo
        if (current_value == 0.0f && next_value == 0.0f)
        {
            continue;
        }

        // Desenhar triângulo entre o ponto atual, o próximo ponto e o centro
        ImVec2 triangle_points[3] = { current_point, next_point, center };
        draw_list->AddConvexPolyFilled(triangle_points, 3, attribute_fill_color);
    }

    std::vector<ImVec2> outline_points;

    for (int i = 0; i < 6; ++i)
    {
        float value = variable_values[i];
        ImVec2 point = attribute_points[i];

        if (value > 0.0f)
        {
            outline_points.push_back(point);
        }
        else
        {
            // Se o valor for zero, adicionar o centro como ponto
            outline_points.push_back(center);
        }
    }

    // Desenhar o contorno
    draw_list->AddPolyline(outline_points.data(), outline_points.size(), attribute_line_color, true, 3.0f);

    // Draw labels aligned with vertices
    const float label_offset = 10.0f;  // 10 px offset
    for (int j = 0; j < 6; ++j)
    {
        float angle = IM_PI / 3.0f * j + rotation_angle;
        float label_radius = max_radius + label_offset;

        // Calculate label position
        ImVec2 label_pos = ImVec2(center.x + cosf(angle) * label_radius, center.y + sinf(angle) * label_radius);

        ImVec2 text_size = ImGui::CalcTextSize(labels[j]);

        // Adjust label position based on angle to align properly
        // Here, we adjust the text position to keep it aligned and provide 10px space

        // Top vertex (STR)
        if (j == 0)
        {
            label_pos.x -= text_size.x * 0.5f;
            label_pos.y -= text_size.y;
        }
        // Upper right vertex (AGI)
        else if (j == 1)
        {
            // No adjustment needed for x
            label_pos.y -= text_size.y * 0.5f;
        }
        // Lower right vertex (VIT)
        else if (j == 2)
        {
            // No adjustment needed for x
            label_pos.y -= text_size.y * 0.5f;
        }
        // Bottom vertex (INT)
        else if (j == 3)
        {
            label_pos.x -= text_size.x * 0.5f;
            // No adjustment needed for y
        }
        // Lower left vertex (DEX)
        else if (j == 4)
        {
            label_pos.x -= text_size.x;
            label_pos.y -= text_size.y * 0.5f;
        }
        // Upper left vertex (LUK)
        else if (j == 5)
        {
            label_pos.x -= text_size.x;
            label_pos.y -= text_size.y * 0.5f;
        }

        draw_list->AddText(label_pos, ImColor(255, 255, 255), labels[j]);
    }
}


algumas partes do gráfico está saindo serrilhada e fora de posição