summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/button.cpp20
-rw-r--r--scene/gui/button.h6
-rw-r--r--scene/gui/color_picker.cpp4
-rw-r--r--scene/gui/line_edit.cpp4
-rw-r--r--scene/gui/spin_box.cpp18
-rw-r--r--scene/gui/spin_box.h4
-rw-r--r--scene/gui/text_edit.cpp64
-rw-r--r--scene/gui/text_edit.h18
-rw-r--r--scene/gui/texture_progress_bar.cpp12
-rw-r--r--scene/gui/video_player.cpp4
10 files changed, 80 insertions, 74 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 9cdf3bf210..e253a27e66 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -427,9 +427,9 @@ Ref<Texture2D> Button::get_icon() const {
return icon;
}
-void Button::set_expand_icon(bool p_expand_icon) {
- if (expand_icon != p_expand_icon) {
- expand_icon = p_expand_icon;
+void Button::set_expand_icon(bool p_enabled) {
+ if (expand_icon != p_enabled) {
+ expand_icon = p_enabled;
update();
minimum_size_changed();
}
@@ -439,9 +439,9 @@ bool Button::is_expand_icon() const {
return expand_icon;
}
-void Button::set_flat(bool p_flat) {
- if (flat != p_flat) {
- flat = p_flat;
+void Button::set_flat(bool p_enabled) {
+ if (flat != p_enabled) {
+ flat = p_enabled;
update();
}
}
@@ -450,9 +450,9 @@ bool Button::is_flat() const {
return flat;
}
-void Button::set_clip_text(bool p_clip_text) {
- if (clip_text != p_clip_text) {
- clip_text = p_clip_text;
+void Button::set_clip_text(bool p_enabled) {
+ if (clip_text != p_enabled) {
+ clip_text = p_enabled;
update();
minimum_size_changed();
}
@@ -553,7 +553,7 @@ void Button::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_text_align"), &Button::get_text_align);
ClassDB::bind_method(D_METHOD("set_icon_align", "icon_align"), &Button::set_icon_align);
ClassDB::bind_method(D_METHOD("get_icon_align"), &Button::get_icon_align);
- ClassDB::bind_method(D_METHOD("set_expand_icon"), &Button::set_expand_icon);
+ ClassDB::bind_method(D_METHOD("set_expand_icon", "enabled"), &Button::set_expand_icon);
ClassDB::bind_method(D_METHOD("is_expand_icon"), &Button::is_expand_icon);
BIND_ENUM_CONSTANT(ALIGN_LEFT);
diff --git a/scene/gui/button.h b/scene/gui/button.h
index 253d079680..fd36cb77af 100644
--- a/scene/gui/button.h
+++ b/scene/gui/button.h
@@ -91,13 +91,13 @@ public:
void set_icon(const Ref<Texture2D> &p_icon);
Ref<Texture2D> get_icon() const;
- void set_expand_icon(bool p_expand_icon);
+ void set_expand_icon(bool p_enabled);
bool is_expand_icon() const;
- void set_flat(bool p_flat);
+ void set_flat(bool p_enabled);
bool is_flat() const;
- void set_clip_text(bool p_clip_text);
+ void set_clip_text(bool p_enabled);
bool get_clip_text() const;
void set_text_align(TextAlign p_align);
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 54548e1941..894175d559 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -1106,9 +1106,9 @@ bool ColorPicker::are_presets_visible() const {
void ColorPicker::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_pick_color", "color"), &ColorPicker::set_pick_color);
ClassDB::bind_method(D_METHOD("get_pick_color"), &ColorPicker::get_pick_color);
- ClassDB::bind_method(D_METHOD("set_hsv_mode"), &ColorPicker::set_hsv_mode);
+ ClassDB::bind_method(D_METHOD("set_hsv_mode", "enabled"), &ColorPicker::set_hsv_mode);
ClassDB::bind_method(D_METHOD("is_hsv_mode"), &ColorPicker::is_hsv_mode);
- ClassDB::bind_method(D_METHOD("set_raw_mode"), &ColorPicker::set_raw_mode);
+ ClassDB::bind_method(D_METHOD("set_raw_mode", "enabled"), &ColorPicker::set_raw_mode);
ClassDB::bind_method(D_METHOD("is_raw_mode"), &ColorPicker::is_raw_mode);
ClassDB::bind_method(D_METHOD("set_deferred_mode", "mode"), &ColorPicker::set_deferred_mode);
ClassDB::bind_method(D_METHOD("is_deferred_mode"), &ColorPicker::is_deferred_mode);
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 653885aa08..54e7d8f960 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -241,7 +241,7 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
_reset_caret_blink_timer();
if (b->is_pressed()) {
- accept_event(); //don't pass event further when clicked on text field
+ accept_event(); // don't pass event further when clicked on text field
if (!text.is_empty() && is_editable() && _is_over_clear_button(b->get_position())) {
clear_button_status.press_attempt = true;
clear_button_status.pressing_inside = true;
@@ -1931,7 +1931,7 @@ void LineEdit::_shape() {
TS->shaped_text_clear(text_rid);
String t;
- if (text.length() == 0) {
+ if (text.length() == 0 && ime_text.length() == 0) {
t = placeholder_translated;
} else if (pass) {
t = secret_character.repeat(text.length() + ime_text.length());
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 0aec017649..0446e1b402 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -253,14 +253,14 @@ String SpinBox::get_prefix() const {
return prefix;
}
-void SpinBox::set_update_on_text_changed(bool p_update) {
- if (update_on_text_changed == p_update) {
+void SpinBox::set_update_on_text_changed(bool p_enabled) {
+ if (update_on_text_changed == p_enabled) {
return;
}
- update_on_text_changed = p_update;
+ update_on_text_changed = p_enabled;
- if (p_update) {
+ if (p_enabled) {
line_edit->connect("text_changed", callable_mp(this, &SpinBox::_text_changed), Vector<Variant>(), CONNECT_DEFERRED);
} else {
line_edit->disconnect("text_changed", callable_mp(this, &SpinBox::_text_changed));
@@ -271,8 +271,8 @@ bool SpinBox::get_update_on_text_changed() const {
return update_on_text_changed;
}
-void SpinBox::set_editable(bool p_editable) {
- line_edit->set_editable(p_editable);
+void SpinBox::set_editable(bool p_enabled) {
+ line_edit->set_editable(p_enabled);
}
bool SpinBox::is_editable() const {
@@ -284,17 +284,15 @@ void SpinBox::apply() {
}
void SpinBox::_bind_methods() {
- //ClassDB::bind_method(D_METHOD("_value_changed"),&SpinBox::_value_changed);
-
ClassDB::bind_method(D_METHOD("set_align", "align"), &SpinBox::set_align);
ClassDB::bind_method(D_METHOD("get_align"), &SpinBox::get_align);
ClassDB::bind_method(D_METHOD("set_suffix", "suffix"), &SpinBox::set_suffix);
ClassDB::bind_method(D_METHOD("get_suffix"), &SpinBox::get_suffix);
ClassDB::bind_method(D_METHOD("set_prefix", "prefix"), &SpinBox::set_prefix);
ClassDB::bind_method(D_METHOD("get_prefix"), &SpinBox::get_prefix);
- ClassDB::bind_method(D_METHOD("set_editable", "editable"), &SpinBox::set_editable);
+ ClassDB::bind_method(D_METHOD("set_editable", "enabled"), &SpinBox::set_editable);
ClassDB::bind_method(D_METHOD("is_editable"), &SpinBox::is_editable);
- ClassDB::bind_method(D_METHOD("set_update_on_text_changed"), &SpinBox::set_update_on_text_changed);
+ ClassDB::bind_method(D_METHOD("set_update_on_text_changed", "enabled"), &SpinBox::set_update_on_text_changed);
ClassDB::bind_method(D_METHOD("get_update_on_text_changed"), &SpinBox::get_update_on_text_changed);
ClassDB::bind_method(D_METHOD("apply"), &SpinBox::apply);
ClassDB::bind_method(D_METHOD("get_line_edit"), &SpinBox::get_line_edit);
diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h
index 9828b894da..f2299ce1c2 100644
--- a/scene/gui/spin_box.h
+++ b/scene/gui/spin_box.h
@@ -82,7 +82,7 @@ public:
void set_align(LineEdit::Align p_align);
LineEdit::Align get_align() const;
- void set_editable(bool p_editable);
+ void set_editable(bool p_enabled);
bool is_editable() const;
void set_suffix(const String &p_suffix);
@@ -91,7 +91,7 @@ public:
void set_prefix(const String &p_prefix);
String get_prefix() const;
- void set_update_on_text_changed(bool p_update);
+ void set_update_on_text_changed(bool p_enabled);
bool get_update_on_text_changed() const;
void apply();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6370ea9c95..dc9a3f337e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -103,11 +103,11 @@ void TextEdit::Text::set_direction_and_language(TextServer::Direction p_directio
is_dirty = true;
}
-void TextEdit::Text::set_draw_control_chars(bool p_draw_control_chars) {
- if (draw_control_chars == p_draw_control_chars) {
+void TextEdit::Text::set_draw_control_chars(bool p_enabled) {
+ if (draw_control_chars == p_enabled) {
return;
}
- draw_control_chars = p_draw_control_chars;
+ draw_control_chars = p_enabled;
is_dirty = true;
}
@@ -2572,8 +2572,8 @@ bool TextEdit::is_overtype_mode_enabled() const {
return overtype_mode;
}
-void TextEdit::set_context_menu_enabled(bool p_enable) {
- context_menu_enabled = p_enable;
+void TextEdit::set_context_menu_enabled(bool p_enabled) {
+ context_menu_enabled = p_enabled;
}
bool TextEdit::is_context_menu_enabled() const {
@@ -2588,8 +2588,8 @@ bool TextEdit::is_shortcut_keys_enabled() const {
return shortcut_keys_enabled;
}
-void TextEdit::set_virtual_keyboard_enabled(bool p_enable) {
- virtual_keyboard_enabled = p_enable;
+void TextEdit::set_virtual_keyboard_enabled(bool p_enabled) {
+ virtual_keyboard_enabled = p_enabled;
}
bool TextEdit::is_virtual_keyboard_enabled() const {
@@ -3504,8 +3504,8 @@ void TextEdit::set_caret_blink_speed(const float p_speed) {
caret_blink_timer->set_wait_time(p_speed);
}
-void TextEdit::set_move_caret_on_right_click_enabled(const bool p_enable) {
- move_caret_on_right_click = p_enable;
+void TextEdit::set_move_caret_on_right_click_enabled(const bool p_enabled) {
+ move_caret_on_right_click = p_enabled;
}
bool TextEdit::is_move_caret_on_right_click_enabled() const {
@@ -3913,9 +3913,9 @@ Vector<String> TextEdit::get_line_wrapped_text(int p_line) const {
/* Viewport */
// Scrolling.
-void TextEdit::set_smooth_scroll_enabled(const bool p_enable) {
- v_scroll->set_smooth_scroll_enabled(p_enable);
- smooth_scroll_enabled = p_enable;
+void TextEdit::set_smooth_scroll_enabled(const bool p_enabled) {
+ v_scroll->set_smooth_scroll_enabled(p_enabled);
+ smooth_scroll_enabled = p_enabled;
}
bool TextEdit::is_smooth_scroll_enabled() const {
@@ -4174,9 +4174,9 @@ void TextEdit::center_viewport_to_caret() {
}
/* Minimap */
-void TextEdit::set_draw_minimap(bool p_draw) {
- if (draw_minimap != p_draw) {
- draw_minimap = p_draw;
+void TextEdit::set_draw_minimap(bool p_enabled) {
+ if (draw_minimap != p_enabled) {
+ draw_minimap = p_enabled;
_update_wrap_at_column();
}
update();
@@ -4457,9 +4457,9 @@ bool TextEdit::is_highlight_all_occurrences_enabled() const {
return highlight_all_occurrences;
}
-void TextEdit::set_draw_control_chars(bool p_draw_control_chars) {
- if (draw_control_chars != p_draw_control_chars) {
- draw_control_chars = p_draw_control_chars;
+void TextEdit::set_draw_control_chars(bool p_enabled) {
+ if (draw_control_chars != p_enabled) {
+ draw_control_chars = p_enabled;
if (menu) {
menu->set_item_checked(menu->get_item_index(MENU_DISPLAY_UCC), draw_control_chars);
}
@@ -4473,8 +4473,8 @@ bool TextEdit::get_draw_control_chars() const {
return draw_control_chars;
}
-void TextEdit::set_draw_tabs(bool p_draw) {
- draw_tabs = p_draw;
+void TextEdit::set_draw_tabs(bool p_enabled) {
+ draw_tabs = p_enabled;
update();
}
@@ -4482,8 +4482,8 @@ bool TextEdit::is_drawing_tabs() const {
return draw_tabs;
}
-void TextEdit::set_draw_spaces(bool p_draw) {
- draw_spaces = p_draw;
+void TextEdit::set_draw_spaces(bool p_enabled) {
+ draw_spaces = p_enabled;
update();
}
@@ -4500,7 +4500,7 @@ void TextEdit::_bind_methods() {
// Text properties
ClassDB::bind_method(D_METHOD("has_ime_text"), &TextEdit::has_ime_text);
- ClassDB::bind_method(D_METHOD("set_editable", "enable"), &TextEdit::set_editable);
+ ClassDB::bind_method(D_METHOD("set_editable", "enabled"), &TextEdit::set_editable);
ClassDB::bind_method(D_METHOD("is_editable"), &TextEdit::is_editable);
ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &TextEdit::set_text_direction);
@@ -4525,13 +4525,13 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_overtype_mode_enabled", "enabled"), &TextEdit::set_overtype_mode_enabled);
ClassDB::bind_method(D_METHOD("is_overtype_mode_enabled"), &TextEdit::is_overtype_mode_enabled);
- ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &TextEdit::set_context_menu_enabled);
+ ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enabled"), &TextEdit::set_context_menu_enabled);
ClassDB::bind_method(D_METHOD("is_context_menu_enabled"), &TextEdit::is_context_menu_enabled);
- ClassDB::bind_method(D_METHOD("set_shortcut_keys_enabled", "enable"), &TextEdit::set_shortcut_keys_enabled);
+ ClassDB::bind_method(D_METHOD("set_shortcut_keys_enabled", "enabled"), &TextEdit::set_shortcut_keys_enabled);
ClassDB::bind_method(D_METHOD("is_shortcut_keys_enabled"), &TextEdit::is_shortcut_keys_enabled);
- ClassDB::bind_method(D_METHOD("set_virtual_keyboard_enabled", "enable"), &TextEdit::set_virtual_keyboard_enabled);
+ ClassDB::bind_method(D_METHOD("set_virtual_keyboard_enabled", "enabled"), &TextEdit::set_virtual_keyboard_enabled);
ClassDB::bind_method(D_METHOD("is_virtual_keyboard_enabled"), &TextEdit::is_virtual_keyboard_enabled);
// Text manipulation
@@ -4766,7 +4766,7 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("center_viewport_to_caret"), &TextEdit::center_viewport_to_caret);
// Minimap
- ClassDB::bind_method(D_METHOD("draw_minimap", "draw"), &TextEdit::set_draw_minimap);
+ ClassDB::bind_method(D_METHOD("set_draw_minimap", "enabled"), &TextEdit::set_draw_minimap);
ClassDB::bind_method(D_METHOD("is_drawing_minimap"), &TextEdit::is_drawing_minimap);
ClassDB::bind_method(D_METHOD("set_minimap_width", "width"), &TextEdit::set_minimap_width);
@@ -4822,16 +4822,16 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_highlight_current_line", "enabled"), &TextEdit::set_highlight_current_line);
ClassDB::bind_method(D_METHOD("is_highlight_current_line_enabled"), &TextEdit::is_highlight_current_line_enabled);
- ClassDB::bind_method(D_METHOD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences);
+ ClassDB::bind_method(D_METHOD("set_highlight_all_occurrences", "enabled"), &TextEdit::set_highlight_all_occurrences);
ClassDB::bind_method(D_METHOD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled);
ClassDB::bind_method(D_METHOD("get_draw_control_chars"), &TextEdit::get_draw_control_chars);
- ClassDB::bind_method(D_METHOD("set_draw_control_chars", "enable"), &TextEdit::set_draw_control_chars);
+ ClassDB::bind_method(D_METHOD("set_draw_control_chars", "enabled"), &TextEdit::set_draw_control_chars);
- ClassDB::bind_method(D_METHOD("set_draw_tabs"), &TextEdit::set_draw_tabs);
+ ClassDB::bind_method(D_METHOD("set_draw_tabs", "enabled"), &TextEdit::set_draw_tabs);
ClassDB::bind_method(D_METHOD("is_drawing_tabs"), &TextEdit::is_drawing_tabs);
- ClassDB::bind_method(D_METHOD("set_draw_spaces"), &TextEdit::set_draw_spaces);
+ ClassDB::bind_method(D_METHOD("set_draw_spaces", "enabled"), &TextEdit::set_draw_spaces);
ClassDB::bind_method(D_METHOD("is_drawing_spaces"), &TextEdit::is_drawing_spaces);
ClassDB::bind_method(D_METHOD("get_menu"), &TextEdit::get_menu);
@@ -4868,7 +4868,7 @@ void TextEdit::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_horizontal"), "set_h_scroll", "get_h_scroll");
ADD_GROUP("Minimap", "minimap_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "minimap_draw"), "draw_minimap", "is_drawing_minimap");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "minimap_draw"), "set_draw_minimap", "is_drawing_minimap");
ADD_PROPERTY(PropertyInfo(Variant::INT, "minimap_width"), "set_minimap_width", "get_minimap_width");
ADD_GROUP("Caret", "caret_");
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 3230de776f..16c1ee9ff9 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -182,7 +182,7 @@ private:
void set_font_size(int p_font_size);
void set_font_features(const Dictionary &p_features);
void set_direction_and_language(TextServer::Direction p_direction, const String &p_language);
- void set_draw_control_chars(bool p_draw_control_chars);
+ void set_draw_control_chars(bool p_enabled);
int get_line_height() const;
int get_line_width(int p_line, int p_wrap_index = -1) const;
@@ -631,13 +631,13 @@ public:
void set_overtype_mode_enabled(const bool p_enabled);
bool is_overtype_mode_enabled() const;
- void set_context_menu_enabled(bool p_enable);
+ void set_context_menu_enabled(bool p_enabled);
bool is_context_menu_enabled() const;
void set_shortcut_keys_enabled(bool p_enabled);
bool is_shortcut_keys_enabled() const;
- void set_virtual_keyboard_enabled(bool p_enable);
+ void set_virtual_keyboard_enabled(bool p_enabled);
bool is_virtual_keyboard_enabled() const;
// Text manipulation
@@ -723,7 +723,7 @@ public:
void set_caret_blink_speed(const float p_speed);
float get_caret_blink_speed() const;
- void set_move_caret_on_right_click_enabled(const bool p_enable);
+ void set_move_caret_on_right_click_enabled(const bool p_enabled);
bool is_move_caret_on_right_click_enabled() const;
void set_caret_mid_grapheme_enabled(const bool p_enabled);
@@ -783,7 +783,7 @@ public:
/* Viewport. */
// Scrolling.
- void set_smooth_scroll_enabled(const bool p_enable);
+ void set_smooth_scroll_enabled(const bool p_enabled);
bool is_smooth_scroll_enabled() const;
void set_scroll_past_end_of_file_enabled(const bool p_enabled);
@@ -818,7 +818,7 @@ public:
void center_viewport_to_caret();
// Minimap
- void set_draw_minimap(bool p_draw);
+ void set_draw_minimap(bool p_enabled);
bool is_drawing_minimap() const;
void set_minimap_width(int p_minimap_width);
@@ -885,13 +885,13 @@ public:
void set_highlight_all_occurrences(const bool p_enabled);
bool is_highlight_all_occurrences_enabled() const;
- void set_draw_control_chars(bool p_draw_control_chars);
+ void set_draw_control_chars(bool p_enabled);
bool get_draw_control_chars() const;
- void set_draw_tabs(bool p_draw);
+ void set_draw_tabs(bool p_enabled);
bool is_drawing_tabs() const;
- void set_draw_spaces(bool p_draw);
+ void set_draw_spaces(bool p_enabled);
bool is_drawing_spaces() const;
TextEdit();
diff --git a/scene/gui/texture_progress_bar.cpp b/scene/gui/texture_progress_bar.cpp
index 35a098c6fd..fe11de128a 100644
--- a/scene/gui/texture_progress_bar.cpp
+++ b/scene/gui/texture_progress_bar.cpp
@@ -341,7 +341,11 @@ void TextureProgressBar::draw_nine_patch_stretched(const Ref<Texture2D> &p_textu
} break;
case FILL_BILINEAR_LEFT_AND_RIGHT: {
double center_mapped_from_real_width = (width_total * 0.5 - topleft.x) / max_middle_real_size * max_middle_texture_size + topleft.x;
- double drift_from_unscaled_center = (src_rect.size.x * 0.5 - center_mapped_from_real_width) * (last_section_size - first_section_size) / (bottomright.x - topleft.x);
+ double drift_from_unscaled_center = 0;
+ if (bottomright.y != topleft.y) { // To avoid division by zero.
+ drift_from_unscaled_center = (src_rect.size.x * 0.5 - center_mapped_from_real_width) * (last_section_size - first_section_size) / (bottomright.x - topleft.x);
+ }
+
src_rect.position.x += center_mapped_from_real_width + drift_from_unscaled_center - width_texture * 0.5;
src_rect.size.x = width_texture;
dst_rect.position.x += (width_total - width_filled) * 0.5;
@@ -351,7 +355,11 @@ void TextureProgressBar::draw_nine_patch_stretched(const Ref<Texture2D> &p_textu
} break;
case FILL_BILINEAR_TOP_AND_BOTTOM: {
double center_mapped_from_real_width = (width_total * 0.5 - topleft.y) / max_middle_real_size * max_middle_texture_size + topleft.y;
- double drift_from_unscaled_center = (src_rect.size.y * 0.5 - center_mapped_from_real_width) * (last_section_size - first_section_size) / (bottomright.y - topleft.y);
+ double drift_from_unscaled_center = 0;
+ if (bottomright.y != topleft.y) { // To avoid division by zero.
+ drift_from_unscaled_center = (src_rect.size.y * 0.5 - center_mapped_from_real_width) * (last_section_size - first_section_size) / (bottomright.y - topleft.y);
+ }
+
src_rect.position.y += center_mapped_from_real_width + drift_from_unscaled_center - width_texture * 0.5;
src_rect.size.y = width_texture;
dst_rect.position.y += (width_total - width_filled) * 0.5;
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 8734037a57..989aabc549 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -29,9 +29,9 @@
/*************************************************************************/
#include "video_player.h"
-#include "scene/scene_string_names.h"
#include "core/os/os.h"
+#include "scene/scene_string_names.h"
#include "servers/audio_server.h"
int VideoPlayer::sp_get_channel_count() const {
@@ -55,7 +55,7 @@ bool VideoPlayer::mix(AudioFrame *p_buffer, int p_frames) {
return false;
}
-// Called from main thread (eg VideoStreamPlaybackWebm::update)
+// Called from main thread (e.g. VideoStreamPlaybackTheora::update).
int VideoPlayer::_audio_mix_callback(void *p_udata, const float *p_data, int p_frames) {
ERR_FAIL_NULL_V(p_udata, 0);
ERR_FAIL_NULL_V(p_data, 0);