Răsfoiți Sursa

Merge pull request #78268 from Sauermann/fix-remove-unused-variable

Remove unused variable `PopupMenu::parent_rect`
Rémi Verschelde 2 ani în urmă
părinte
comite
6587a81910

+ 0 - 1
editor/gui/editor_object_selector.cpp

@@ -100,7 +100,6 @@ void EditorObjectSelector::_show_popup() {
 
 	sub_objects_menu->set_position(gp);
 	sub_objects_menu->set_size(Size2(size.width, 1));
-	sub_objects_menu->set_parent_rect(Rect2(Point2(gp - sub_objects_menu->get_position()), size));
 
 	sub_objects_menu->take_mouse_focus();
 	sub_objects_menu->popup();

+ 0 - 1
scene/gui/menu_bar.cpp

@@ -131,7 +131,6 @@ void MenuBar::_open_popup(int p_index, bool p_focus_item) {
 		screen_pos.x += screen_size.x - pm->get_size().width;
 	}
 	pm->set_position(screen_pos);
-	pm->set_parent_rect(Rect2(Point2(screen_pos - pm->get_position()), Size2(screen_size.x, screen_pos.y)));
 	pm->popup();
 
 	if (p_focus_item) {

+ 0 - 1
scene/gui/menu_button.cpp

@@ -106,7 +106,6 @@ void MenuButton::show_popup() {
 		gp.x += size.width - popup->get_size().width;
 	}
 	popup->set_position(gp);
-	popup->set_parent_rect(Rect2(Point2(gp - popup->get_position()), size));
 
 	// If not triggered by the mouse, start the popup with its first enabled item focused.
 	if (!_was_pressed_by_mouse()) {

+ 0 - 4
scene/gui/popup_menu.cpp

@@ -2033,10 +2033,6 @@ String PopupMenu::get_tooltip(const Point2 &p_pos) const {
 	return items[over].tooltip;
 }
 
-void PopupMenu::set_parent_rect(const Rect2 &p_rect) {
-	parent_rect = p_rect;
-}
-
 void PopupMenu::add_autohide_area(const Rect2 &p_area) {
 	autohide_areas.push_back(p_area);
 }

+ 0 - 3
scene/gui/popup_menu.h

@@ -98,7 +98,6 @@ class PopupMenu : public Popup {
 	bool during_grabbed_click = false;
 	int mouse_over = -1;
 	int submenu_over = -1;
-	Rect2 parent_rect;
 	String _get_accel_text(const Item &p_item) const;
 	int _get_mouse_over(const Point2 &p_over) const;
 	virtual Size2 _get_contents_minimum_size() const override;
@@ -292,8 +291,6 @@ public:
 
 	void clear();
 
-	void set_parent_rect(const Rect2 &p_rect);
-
 	virtual String get_tooltip(const Point2 &p_pos) const;
 
 	void add_autohide_area(const Rect2 &p_area);