File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Renderer Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,8 @@ private void DrawLyrics(
135135 var effectSettings = windowStatus . LyricsEffectSettings ;
136136 var styleSettings = windowStatus . LyricsStyleSettings ;
137137
138- var rotationY = currentPlayingLine . OriginalPosition . WithX ( effectSettings . FanLyricsAngle < 0 ? ( float ) lyricsWidth : 0 ) ;
138+ var rotationX = effectSettings . FanLyricsAngle < 0 ? lyricsWidth : 0 ;
139+ rotationX += lyricsWidth / 2 * ( effectSettings . FanLyricsAngle < 0 ? 1 : - 1 ) ;
139140
140141 for ( int i = startVisibleIndex ; i <= endVisibleIndex ; i ++ )
141142 {
@@ -145,12 +146,15 @@ private void DrawLyrics(
145146 if ( line . OriginalCanvasTextLayout == null ) continue ;
146147 if ( line . OriginalCanvasTextLayout . LayoutBounds . Width <= 0 ) continue ;
147148
149+ var rotationY = line . CenterPosition . Y ;
150+
151+ double xOffset = lyricsX + Math . Abs ( line . AngleTransition . Value ) / ( Math . PI / 2 ) * lyricsWidth / 2 * ( effectSettings . FanLyricsAngle < 0 ? 1 : - 1 ) ;
148152 double yOffset = line . YOffsetTransition . Value + userScrollOffset + lyricsY + lyricsHeight * playingLineTopOffsetFactor ;
149153
150154 var transform =
151155 Matrix3x2 . CreateScale ( ( float ) line . ScaleTransition . Value , line . CenterPosition ) *
152- Matrix3x2 . CreateRotation ( ( float ) line . AngleTransition . Value , rotationY ) *
153- Matrix3x2 . CreateTranslation ( ( float ) lyricsX , ( float ) yOffset ) ;
156+ Matrix3x2 . CreateRotation ( ( float ) line . AngleTransition . Value , new Vector2 ( ( float ) rotationX , rotationY ) ) *
157+ Matrix3x2 . CreateTranslation ( ( float ) xOffset , ( float ) yOffset ) ;
154158
155159 ds . Transform = transform ;
156160
You can’t perform that action at this time.
0 commit comments