summaryrefslogtreecommitdiff
path: root/scene/resources/rectangle_shape_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/rectangle_shape_2d.cpp')
-rw-r--r--scene/resources/rectangle_shape_2d.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp
index 84c147b4b4..65b1653293 100644
--- a/scene/resources/rectangle_shape_2d.cpp
+++ b/scene/resources/rectangle_shape_2d.cpp
@@ -79,11 +79,7 @@ void RectangleShape2D::draw(const RID &p_to_rid, const Color &p_color) {
stroke_points.write[3] = Vector2(-size.x, size.y) * 0.5;
stroke_points.write[4] = -size * 0.5;
- Vector<Color> stroke_colors;
- stroke_colors.resize(5);
- for (int i = 0; i < 5; i++) {
- stroke_colors.write[i] = (p_color);
- }
+ Vector<Color> stroke_colors = { Color(p_color, 1.0) };
RenderingServer::get_singleton()->canvas_item_add_polyline(p_to_rid, stroke_points, stroke_colors);
}