diff options
Diffstat (limited to 'scene/gui/popup_menu.cpp')
-rw-r--r-- | scene/gui/popup_menu.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index a2a670fa1f..6ac6eac655 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -6,6 +6,7 @@ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -168,7 +169,7 @@ void PopupMenu::_activate_submenu(int over) { if (pm->is_visible_in_tree()) return; //already visible! - Point2 p = get_global_pos(); + Point2 p = get_global_position(); Rect2 pr(p, get_size()); Ref<StyleBox> style = get_stylebox("panel"); @@ -178,13 +179,13 @@ void PopupMenu::_activate_submenu(int over) { if (pos.x + size.width > get_viewport_rect().size.width) pos.x = p.x - size.width; - pm->set_pos(pos); + pm->set_position(pos); pm->popup(); PopupMenu *pum = pm->cast_to<PopupMenu>(); if (pum) { - pr.pos -= pum->get_global_pos(); + pr.pos -= pum->get_global_position(); pum->clear_autohide_areas(); pum->add_autohide_area(Rect2(pr.pos.x, pr.pos.y, pr.size.x, items[over]._ofs_cache)); if (over < items.size() - 1) { @@ -265,15 +266,15 @@ void PopupMenu::_gui_input(const InputEvent &p_event) { case BUTTON_WHEEL_DOWN: { - if (get_global_pos().y + get_size().y > get_viewport_rect().size.y) { + if (get_global_position().y + get_size().y > get_viewport_rect().size.y) { int vseparation = get_constant("vseparation"); Ref<Font> font = get_font("font"); - Point2 pos = get_pos(); + Point2 pos = get_position(); int s = (vseparation + font->get_height()) * 3; pos.y -= s; - set_pos(pos); + set_position(pos); //update hover InputEvent ie; @@ -285,15 +286,15 @@ void PopupMenu::_gui_input(const InputEvent &p_event) { } break; case BUTTON_WHEEL_UP: { - if (get_global_pos().y < 0) { + if (get_global_position().y < 0) { int vseparation = get_constant("vseparation"); Ref<Font> font = get_font("font"); - Point2 pos = get_pos(); + Point2 pos = get_position(); int s = (vseparation + font->get_height()) * 3; pos.y += s; - set_pos(pos); + set_position(pos); //update hover InputEvent ie; |