ItemList: Remove redundant Vector2 initializations.

This commit is contained in:
Andreas Haas 2017-08-02 21:48:50 +02:00
parent 5c361485db
commit aef974e7a8
No known key found for this signature in database
GPG key ID: B5FFAE1B65FBD2E1

View file

@ -431,7 +431,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && (mb->get_button_index() == BUTTON_LEFT || (allow_rmb_select && mb->get_button_index() == BUTTON_RIGHT)) && mb->is_pressed()) {
search_string = ""; //any mousepress cancels
Vector2 pos(mb->get_position().x, mb->get_position().y);
Vector2 pos = mb->get_position();
Ref<StyleBox> bg = get_stylebox("bg");
pos -= bg->get_offset();
pos.y += scroll_bar->get_value();
@ -475,7 +475,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (mb->get_button_index() == BUTTON_RIGHT) {
emit_signal("item_rmb_selected", i, Vector2(mb->get_position().x, mb->get_position().y));
emit_signal("item_rmb_selected", i, pos);
}
} else {
@ -486,7 +486,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (items[i].selected && mb->get_button_index() == BUTTON_RIGHT) {
emit_signal("item_rmb_selected", i, Vector2(mb->get_position().x, mb->get_position().y));
emit_signal("item_rmb_selected", i, pos);
} else {
bool selected = !items[i].selected;
@ -501,7 +501,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (mb->get_button_index() == BUTTON_RIGHT) {
emit_signal("item_rmb_selected", i, Vector2(mb->get_position().x, mb->get_position().y));
emit_signal("item_rmb_selected", i, pos);
} else if (/*select_mode==SELECT_SINGLE &&*/ mb->is_doubleclick()) {
emit_signal("item_activated", i);