Fix wrong cast to Node2D instead of Control

As reported by @sanikoyes.
This commit is contained in:
Rémi Verschelde 2017-07-08 09:42:48 +02:00
parent 025f3501ed
commit 095f0c956e

View file

@ -1170,7 +1170,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
canvas_item->edit_set_state(se->undo_state); canvas_item->edit_set_state(se->undo_state);
if (canvas_item->cast_to<Node2D>()) if (canvas_item->cast_to<Node2D>())
canvas_item->cast_to<Node2D>()->edit_set_pivot(se->undo_pivot); canvas_item->cast_to<Node2D>()->edit_set_pivot(se->undo_pivot);
if (canvas_item->cast_to<Node2D>()) if (canvas_item->cast_to<Control>())
canvas_item->cast_to<Control>()->set_pivot_offset(se->undo_pivot); canvas_item->cast_to<Control>()->set_pivot_offset(se->undo_pivot);
} }
} }