summaryrefslogtreecommitdiff
path: root/editor/plugins/polygon_2d_editor_plugin.cpp
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-25 14:46:45 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-25 14:46:45 +0545
commitcdd912c48eab15f581459afc2cda8fdcfabf92db (patch)
treed2d4ce59b2e55c8947103fc40ce1258728a8dc65 /editor/plugins/polygon_2d_editor_plugin.cpp
parent5e4a71200e25811d8e570d87f08f0878dabb8bb9 (diff)
Construct values only when necessary.
Diffstat (limited to 'editor/plugins/polygon_2d_editor_plugin.cpp')
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp2
1 files changed, 1 insertions, 1 deletions
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<InputEvent> &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);