From cdd912c48eab15f581459afc2cda8fdcfabf92db Mon Sep 17 00:00:00 2001 From: Anilforextra Date: Sat, 25 Sep 2021 14:46:45 +0545 Subject: Construct values only when necessary. --- editor/plugins/polygon_2d_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editor/plugins/polygon_2d_editor_plugin.cpp') diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index ac18ff9f1c..5afe9ed60c 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -779,7 +779,7 @@ void Polygon2DEditor::_uv_input(const Ref &p_input) { if (mm.is_valid()) { if ((mm->get_button_mask() & MOUSE_BUTTON_MASK_MIDDLE) || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { - Vector2 drag(mm->get_relative().x, mm->get_relative().y); + Vector2 drag = mm->get_relative(); uv_hscroll->set_value(uv_hscroll->get_value() - drag.x); uv_vscroll->set_value(uv_vscroll->get_value() - drag.y); -- cgit v1.2.3