mirror of
https://github.com/godotengine/godot.git
synced 2024-12-03 09:52:18 +08:00
Fix errors and crash with empty ConvexPolygonShape2D
This commit is contained in:
parent
f01e95eb55
commit
6fb6090748
@ -72,6 +72,10 @@ void ConvexPolygonShape2D::_bind_methods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConvexPolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) {
|
void ConvexPolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) {
|
||||||
|
if (points.size() < 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vector<Color> col;
|
Vector<Color> col;
|
||||||
col.push_back(p_color);
|
col.push_back(p_color);
|
||||||
RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
|
RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col);
|
||||||
|
Loading…
Reference in New Issue
Block a user