fix lyrics text not centered

This commit is contained in:
Pato05 2024-05-02 17:10:01 +02:00
parent 1738c1bf00
commit aaacd150a5
No known key found for this signature in database
GPG Key ID: ED4C6F9C3D574FB6
1 changed files with 2 additions and 3 deletions

View File

@ -136,9 +136,8 @@ class _LyricsWidgetState extends State<LyricsWidget>
//Lyric height, screen height, appbar height
final actualHeight =
height + (_showTranslation ? additionalTranslationHeight : 0.0);
// _currentIndex + 1 because there's also the initial one
final minScroll = actualHeight * (_currentIndex + 1);
double scrollTo = minScroll + height / 2;
// _currentIndex + 1 because there's also the initial one (though we need to sum half)
var scrollTo = actualHeight * (_currentIndex + 1);
if (scrollTo < 0.0) scrollTo = 0.0;
if (scrollTo > _controller.position.maxScrollExtent) {