mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:24:55 +08:00
fix: 3d lyrics effect incorrect y center
This commit is contained in:
@@ -548,11 +548,12 @@ namespace BetterLyrics.WinUI3.Controls
|
|||||||
_isMouseScrollingChanged = false;
|
_isMouseScrollingChanged = false;
|
||||||
|
|
||||||
_lyricsRenderer.CalculateLyrics3DMatrix(
|
_lyricsRenderer.CalculateLyrics3DMatrix(
|
||||||
|
lyricsStyle: lyricsStyle,
|
||||||
lyricsEffect: lyricsEffect,
|
lyricsEffect: lyricsEffect,
|
||||||
lyricsX: _renderLyricsStartX,
|
lyricsX: _renderLyricsStartX,
|
||||||
lyricsY: _renderLyricsStartY,
|
lyricsY: _renderLyricsStartY,
|
||||||
lyricsWidth: _renderLyricsWidth,
|
lyricsWidth: _renderLyricsWidth,
|
||||||
canvasHeight: sender.Size.Height
|
lyricsHeight: _renderLyricsHeight
|
||||||
);
|
);
|
||||||
|
|
||||||
_isLayoutChanged = false;
|
_isLayoutChanged = false;
|
||||||
|
|||||||
@@ -233,13 +233,15 @@ namespace BetterLyrics.WinUI3.Renderer
|
|||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CalculateLyrics3DMatrix(LyricsEffectSettings lyricsEffect, double lyricsX, double lyricsY, double lyricsWidth, double canvasHeight)
|
public void CalculateLyrics3DMatrix(LyricsStyleSettings lyricsStyle, LyricsEffectSettings lyricsEffect, double lyricsX, double lyricsY, double lyricsWidth, double lyricsHeight)
|
||||||
{
|
{
|
||||||
if (!lyricsEffect.Is3DLyricsEnabled) return;
|
if (!lyricsEffect.Is3DLyricsEnabled) return;
|
||||||
|
|
||||||
|
var playingLineTopOffsetFactor = lyricsStyle.PlayingLineTopOffset / 100.0;
|
||||||
|
|
||||||
Vector3 center = new(
|
Vector3 center = new(
|
||||||
(float)(lyricsX + lyricsWidth / 2),
|
(float)(lyricsX + lyricsWidth / 2),
|
||||||
(float)(lyricsY + canvasHeight / 2),
|
(float)(lyricsY + lyricsHeight * playingLineTopOffsetFactor / 2),
|
||||||
0);
|
0);
|
||||||
|
|
||||||
float rotationX = (float)(Math.PI * lyricsEffect.Lyrics3DXAngle / 180.0);
|
float rotationX = (float)(Math.PI * lyricsEffect.Lyrics3DXAngle / 180.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user