1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Disallow polygon2D editing if internal vertices exists, as suggested in #24853

This commit is contained in:
Juan Linietsky
2019-02-13 13:11:39 -03:00
parent 7f69da488e
commit 419fb45a3e
4 changed files with 19 additions and 0 deletions

View File

@@ -52,6 +52,16 @@ Vector2 Polygon2DEditor::_get_offset(int p_idx) const {
return node->get_offset();
}
String Polygon2DEditor::_why_cant_edit_polygon() const {
if (node->get_internal_vertex_count() > 0) {
return TTR("Polygon 2D has internal vertices, so it can no longer be edited in the viewport.");
}
return String();
}
int Polygon2DEditor::_get_polygon_count() const {
if (node->get_internal_vertex_count() > 0) {
return 0; //do not edit if internal vertices exist