From 4100e3b6a24dab4f970a7788dd6052bb9001cb28 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 26 Aug 2023 22:09:26 +0200 Subject: [PATCH] Fix issues with the outline mesh generation in PaintCurve2D. --- modules/paint/nodes/curve_2d/paint_curve_2d.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/paint/nodes/curve_2d/paint_curve_2d.cpp b/modules/paint/nodes/curve_2d/paint_curve_2d.cpp index 4b7123b6c..49ac15af3 100644 --- a/modules/paint/nodes/curve_2d/paint_curve_2d.cpp +++ b/modules/paint/nodes/curve_2d/paint_curve_2d.cpp @@ -454,12 +454,23 @@ void PaintCurve2D::generate_polyline_mesh(const Vector &p_points, float r_indices.write[iindx + 2] = indx + 3; r_indices.write[iindx + 3] = indx; - r_indices.write[iindx + 4] = indx + 2; - r_indices.write[iindx + 5] = indx + 3; + r_indices.write[iindx + 4] = indx + 3; + r_indices.write[iindx + 5] = indx + 2; } prev_t = t; } + + int indx = (p_points.size() - 1) * 2; + int iindx = (p_points.size() - 1) * 6; + + r_indices.write[iindx] = indx; + r_indices.write[iindx + 1] = indx + 1; + r_indices.write[iindx + 2] = 1; + + r_indices.write[iindx + 3] = indx; + r_indices.write[iindx + 4] = 1; + r_indices.write[iindx + 5] = 0; } void PaintCurve2D::_prepare_render_data_fill(Vector &r_points, Vector &r_uvs, Vector &r_colors, Vector &r_indices) {