mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4.
This commit is contained in:
@@ -61,19 +61,19 @@ void MenuButton::_popup_visibility_changed(bool p_visible) {
|
||||
}
|
||||
|
||||
if (switch_on_hover) {
|
||||
Window *window = Object::cast_to<Window>(get_viewport());
|
||||
if (window) {
|
||||
mouse_pos_adjusted = window->get_position();
|
||||
Window *wnd = Object::cast_to<Window>(get_viewport());
|
||||
if (wnd) {
|
||||
mouse_pos_adjusted = wnd->get_position();
|
||||
|
||||
if (window->is_embedded()) {
|
||||
Window *window_parent = Object::cast_to<Window>(window->get_parent()->get_viewport());
|
||||
while (window_parent) {
|
||||
if (!window_parent->is_embedded()) {
|
||||
mouse_pos_adjusted += window_parent->get_position();
|
||||
if (wnd->is_embedded()) {
|
||||
Window *wnd_parent = Object::cast_to<Window>(wnd->get_parent()->get_viewport());
|
||||
while (wnd_parent) {
|
||||
if (!wnd_parent->is_embedded()) {
|
||||
mouse_pos_adjusted += wnd_parent->get_position();
|
||||
break;
|
||||
}
|
||||
|
||||
window_parent = Object::cast_to<Window>(window_parent->get_parent()->get_viewport());
|
||||
wnd_parent = Object::cast_to<Window>(wnd_parent->get_parent()->get_viewport());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user