Repository: godot
Issue: draw_polyline The display intermittently breaks when two points jump too much,but Using draw line will not appear
Labels: topic:rendering,needs testing,topic:2d

### Tested versions

Godot Engine v4.3.stable.

### System information

Window10 godot-cpp4.3

### Issue description

```
    // draw_line 当巨大跳跃不会出现  间断点
    //but Using draw line will not appear
    // for (const auto &array : points)
    // {
    //     if (array.size() >= 2) // 确保至少有2个点
    //     {
    //         for (size_t i = 1; i < array.size(); ++i)
    //         {
    //             draw_line(array[i - 1], array[i], lineColor, line_thickness);
    //         }
    //     }
    // }



    // draw_polyline 当巨大跳跃 会出现间断点
    //draw_polyline The display intermittently breaks when two points jump too much
    for (const auto &array : points)
    {
        if (array.size() >= 2) // 确保至少有2个点
        {
            PackedVector2Array packed_array;
            for (const auto &point : array)
            {
                packed_array.push_back(point);
            }
            draw_polyline(packed_array, lineColor, line_thickness, antialiased);
        }
    }
```
mark time :01:13:51
![c7323af0f94d75cc31b9e37b5682db8](https://github.com/user-attachments/assets/735252fb-d23b-42e9-8b37-f09a38b75a92)
![9526a93140a96751f0d61ad2daaaa40](https://github.com/user-attachments/assets/647e9eae-b71a-4d92-b44e-c49eb6268f90)

### Steps to reproduce

```
void waveformRendering::_draw()
{
    if (mapped_view_to_ecgrawDat == NULL)
    {
        UtilityFunctions::print("File not mapped");
        return;
    }

    char *current_position = mapped_view_to_ecgrawDat + m_drawline_start_index * 36;

    points.clear();
    points.resize(12); // 预先分配空间

    float y_Translate_item = 100.0;
    std::vector<float> lead_translates(12);
    for (int i = 0; i < 12; ++i)
    {
        lead_translates[i] = 100.0 + i * y_Translate_item;
    }

    float m_x_line_standard_gain = 1.0;
    float m_y_line_standard_gain = 1.0;
    float InputScalar_y_line_standard_gain = 0.100;

    if (current_position != NULL)
    {
        for (int i = 0; i < sampling_number; i++)
        {
            float x = i * m_x_line_standard_gain * 0.25;

            for (int j = 0; j < 12; j++)
            {
                unsigned char low4 = static_cast<unsigned char>(current_position[0]) & 0x0F;
                unsigned short low16 = (static_cast<unsigned char>(current_position[1]) << 8) |
                                       static_cast<unsigned char>(current_position[2]);
                short tmp1 = (low4 << 16) | low16;

                float y = tmp1 * m_y_line_standard_gain * (-1) * InputScalar_y_line_standard_gain + lead_translates[j];

                points[j].emplace_back(x, y);

                current_position += 3;
            }

            if ((i + m_drawline_start_index) % 500 == 0)
            {
                Vector2 component_size = get_size();
                int timestamp = (i + m_drawline_start_index) * 2;
                String timestamp_text = convert_from_timestamp_hh_mm_ss(timestamp);
                float text_width = default_font->get_string_size(timestamp_text).x;
                Vector2 text_position = Vector2(x - text_width / 2 - 8, component_size.y - 20);

                draw_string(default_font, text_position, U"" + (timestamp_text), HORIZONTAL_ALIGNMENT_CENTER, -1, 20.0, godot::Color(0, 0, 0));
                draw_line(Vector2(x, component_size.y - 20), Vector2(x, component_size.y), Color(0, 0, 0), 2.0);
            }
        }
    }

    Color lineColor(0, 0, 0);
    float line_thickness = 1.0;
    bool antialiased = false;

    // draw_line 当巨大跳跃不会出现  间断点
    //but Using draw line will not appear
    // for (const auto &array : points)
    // {
    //     if (array.size() >= 2) // 确保至少有2个点
    //     {
    //         for (size_t i = 1; i < array.size(); ++i)
    //         {
    //             draw_line(array[i - 1], array[i], lineColor, line_thickness);
    //         }
    //     }
    // }



    // draw_polyline 当巨大跳跃 会出现间断点
    //draw_polyline The display intermittently breaks when two points jump too much
    for (const auto &array : points)
    {
        if (array.size() >= 2) // 确保至少有2个点
        {
            PackedVector2Array packed_array;
            for (const auto &point : array)
            {
                packed_array.push_back(point);
            }
            draw_polyline(packed_array, lineColor, line_thickness, antialiased);
        }
    }
}
```

### Minimal reproduction project (MRP)

[src.zip](https://github.com/user-attachments/files/16874157/src.zip)