aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/collision_polygon_2d_editor_plugin.cpp
diff options
context:
space:
mode:
authorScayze2017-08-25 19:51:07 +0200
committerRémi Verschelde2017-08-30 12:52:06 +0200
commitfbda0cc45c2f50b9b30175c4f2398b8a73d7bf4a (patch)
tree6d755859892c545558703ce70dde682f20bd7123 /editor/plugins/collision_polygon_2d_editor_plugin.cpp
parent98ad0e5a024d3c6d9097548f139b3b2bb05e0e8e (diff)
downloadgodot-fbda0cc45c2f50b9b30175c4f2398b8a73d7bf4a.tar.gz
godot-fbda0cc45c2f50b9b30175c4f2398b8a73d7bf4a.tar.zst
godot-fbda0cc45c2f50b9b30175c4f2398b8a73d7bf4a.zip
AutoUse Pencil on Polygon creation
Diffstat (limited to 'editor/plugins/collision_polygon_2d_editor_plugin.cpp')
-rw-r--r--editor/plugins/collision_polygon_2d_editor_plugin.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp
index c90462db1..38f95d827 100644
--- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp
@@ -344,6 +344,10 @@ void CollisionPolygon2DEditor::edit(Node *p_collision_polygon) {
if (p_collision_polygon) {
node = Object::cast_to<CollisionPolygon2D>(p_collision_polygon);
+ //Enable the pencil tool if the polygon is empty
+ if (node->get_polygon().size() == 0) {
+ _menu_option(MODE_CREATE);
+ }
if (!canvas_item_editor->get_viewport_control()->is_connected("draw", this, "_canvas_draw"))
canvas_item_editor->get_viewport_control()->connect("draw", this, "_canvas_draw");
wip.clear();