diff options
Diffstat (limited to 'editor/editor_audio_buses.cpp')
-rw-r--r-- | editor/editor_audio_buses.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index dd9f10a23b..5e4e375db4 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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 */ @@ -324,7 +324,7 @@ float EditorAudioBus::_normalized_volume_to_scaled_db(float normalized) { /* There are three different formulas for the conversion from normalized * values to relative decibal values. * One formula is an exponential graph which intends to counteract - * the logorithmic nature of human hearing. This is an approximation + * the logarithmic nature of human hearing. This is an approximation * of the behaviour of a 'logarithmic potentiometer' found on most * musical instruments and also emulated in popular software. * The other two equations are hand-tuned linear tapers that intend to @@ -487,7 +487,8 @@ void EditorAudioBus::_effect_edited() { if (effect->get_metadata(0) == Variant()) { Rect2 area = effects->get_item_rect(effect); - effect_options->set_position(effects->get_global_position() + area.position + Vector2(0, area.size.y)); + effect_options->set_position(effects->get_screen_position() + area.position + Vector2(0, area.size.y)); + effect_options->reset_size(); effect_options->popup(); //add effect } else { @@ -535,8 +536,8 @@ void EditorAudioBus::gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid() && mb->get_button_index() == MouseButton::RIGHT && mb->is_pressed()) { - Vector2 pos = mb->get_position(); - bus_popup->set_position(get_global_position() + pos); + bus_popup->set_position(get_screen_position() + mb->get_position()); + bus_popup->reset_size(); bus_popup->popup(); } } @@ -737,7 +738,8 @@ void EditorAudioBus::_effect_rmb(const Vector2 &p_pos) { return; } - delete_effect_popup->set_position(get_global_mouse_position()); + delete_effect_popup->set_position(get_screen_position() + get_local_mouse_position()); + delete_effect_popup->reset_size(); delete_effect_popup->popup(); } @@ -1161,7 +1163,7 @@ void EditorAudioBuses::_server_save() { } void EditorAudioBuses::_select_layout() { - EditorNode::get_singleton()->get_filesystem_dock()->select_file(edited_path); + FileSystemDock::get_singleton()->select_file(edited_path); } void EditorAudioBuses::_save_as_layout() { @@ -1296,8 +1298,7 @@ EditorAudioBuses::EditorAudioBuses() { bus_scroll = memnew(ScrollContainer); bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL); - bus_scroll->set_enable_h_scroll(true); - bus_scroll->set_enable_v_scroll(false); + bus_scroll->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); add_child(bus_scroll); bus_hb = memnew(HBoxContainer); bus_hb->set_v_size_flags(SIZE_EXPAND_FILL); @@ -1421,7 +1422,7 @@ void EditorAudioMeterNotches::_draw_audio_notches() { Vector2((line_length + label_space) * EDSCALE, (1.0f - n.relative_position) * (get_size().y - btm_padding - top_padding) + (font_height / 4) + top_padding), String::num(Math::abs(n.db_value)) + "dB", - HALIGN_LEFT, -1, font_size, + HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, notch_color); } } |