Skip to content

Commit

Permalink
Revert "Remove signal connections"
Browse files Browse the repository at this point in the history
This reverts commit f94c2f6.
  • Loading branch information
aXu-AP committed Nov 20, 2024
1 parent f94c2f6 commit f6cb4a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions editor/plugins/polygon_2d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,19 @@ Node2D *Polygon2DEditor::_get_node() const {

void Polygon2DEditor::_set_node(Node *p_polygon) {
CanvasItem *draw = Object::cast_to<CanvasItem>(uv_edit_draw);
if (node) {
node->disconnect("draw", callable_mp(draw, &CanvasItem::queue_redraw));
node->disconnect("draw", callable_mp(this, &Polygon2DEditor::_update_available_modes));
}

node = Object::cast_to<Polygon2D>(p_polygon);
_update_polygon_editing_state();
uv_edit_draw->queue_redraw();
if (node) {
_menu_option(MODE_EDIT_UV);
// Whenever polygon gets redrawn, there's possible changes for the editor as well.
node->connect("draw", callable_mp(draw, &CanvasItem::queue_redraw));
node->connect("draw", callable_mp(this, &Polygon2DEditor::_update_available_modes));
}
}

Expand Down

0 comments on commit f6cb4a0

Please sign in to comment.