diff options
author | Alessandro Famà <me@alessandrofama.com> | 2024-01-05 12:24:56 +0100 |
---|---|---|
committer | Alessandro Famà <me@alessandrofama.com> | 2024-01-05 12:41:30 +0100 |
commit | 155bebfdf23ef05f4200e7741baaec28a681289b (patch) | |
tree | fd5887a6a98a1596f7cbca8325e2010447a2919c | |
parent | 179dfdc8d78b5bd5377dd115af026df58308bdaf (diff) | |
download | redot-engine-155bebfdf23ef05f4200e7741baaec28a681289b.tar.gz |
Fix playback position label update in Audio Stream Importer
The current playback position label doesn't get updated if the playhead is not visible. The label is updated in `_draw_indicator()` at the end of the function, but we return early if the calculated offset falls outside the valid range. This fix moves the label updating above this check, ensuring that the label always gets updated regardless of the visibility of the playhead.
Fixes #86550.
-rw-r--r-- | editor/import/audio_stream_import_settings.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp index 5414c6e74b..bc96191d33 100644 --- a/editor/import/audio_stream_import_settings.cpp +++ b/editor/import/audio_stream_import_settings.cpp @@ -277,6 +277,8 @@ void AudioStreamImportSettingsDialog::_draw_indicator() { rect.size.height -= y_ofs; } + _current_label->set_text(String::num(_current, 2).pad_decimals(2) + " /"); + float ofs_x = (_current - zoom_bar->get_value()) * rect.size.width / zoom_bar->get_page(); if (ofs_x < 0 || ofs_x >= rect.size.width) { return; @@ -310,8 +312,6 @@ void AudioStreamImportSettingsDialog::_draw_indicator() { } } } - - _current_label->set_text(String::num(_current, 2).pad_decimals(2) + " /"); } void AudioStreamImportSettingsDialog::_on_indicator_mouse_exited() { |