mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:08:33 +08:00
fix: ncm return exception when roman is null
This commit is contained in:
@@ -46,7 +46,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
return new OpacityEffect
|
||||
{
|
||||
Source = backgroundFontEffect,
|
||||
Opacity = (float)(lyricsLine.OpacityTransition.Value * lyricsLayerOpacity),
|
||||
Opacity = (float)Math.Clamp(lyricsLine.OpacityTransition.Value * lyricsLayerOpacity, 0, 1),
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -60,7 +60,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
BorderMode = EffectBorderMode.Soft,
|
||||
Optimization = EffectOptimization.Speed,
|
||||
},
|
||||
Opacity = (float)Math.Max(lyricsLine.OpacityTransition.Value * lyricsLayerOpacity, 0),
|
||||
Opacity = (float)Math.Clamp(lyricsLine.OpacityTransition.Value * lyricsLayerOpacity, 0, 1),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
Source = foregroundFontEffect,
|
||||
AlphaMask = mask,
|
||||
},
|
||||
BlurAmount = (float)glowEffectAmount,
|
||||
BlurAmount = (float)Math.Clamp(glowEffectAmount, 0, 100),
|
||||
Optimization = EffectOptimization.Speed,
|
||||
};
|
||||
}
|
||||
@@ -358,7 +358,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
Source = foregroundFontEffect,
|
||||
AlphaMask = mask,
|
||||
},
|
||||
Opacity = (float)opacity,
|
||||
Opacity = (float)Math.Clamp(opacity, 0, 1),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
AlphaMask = mask,
|
||||
},
|
||||
ShadowColor = shadowColor,
|
||||
BlurAmount = (float)shadowAmount,
|
||||
BlurAmount = (float)Math.Clamp(shadowAmount, 0, 100),
|
||||
Optimization = EffectOptimization.Speed,
|
||||
};
|
||||
}
|
||||
@@ -386,7 +386,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
Source = foregroundFontEffect,
|
||||
AlphaMask = mask,
|
||||
},
|
||||
Opacity = (float)opacity,
|
||||
Opacity = (float)Math.Clamp(opacity, 0, 1),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -592,7 +592,7 @@ namespace BetterLyrics.WinUI3.Services.LyricsSearchService
|
||||
|
||||
lyricsSearchResult.Raw = response?.Lrc?.Lyric;
|
||||
lyricsSearchResult.Translation = response?.Tlyric?.Lyric;
|
||||
lyricsSearchResult.Transliteration = response?.Romalrc.Lyric;
|
||||
lyricsSearchResult.Transliteration = response?.Romalrc?.Lyric;
|
||||
lyricsSearchResult.Reference = $"https://music.163.com/song?id={neteaseResult.Id}";
|
||||
}
|
||||
else if (result is KugouSearchResult kugouResult)
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel
|
||||
combinedDs.DrawImage(new OpacityEffect
|
||||
{
|
||||
Source = effectLayer,
|
||||
Opacity = (float)Math.Max(line.HighlightOpacityTransition.Value * _lyricsOpacityTransition.Value, 0),
|
||||
Opacity = (float)Math.Clamp(line.HighlightOpacityTransition.Value * _lyricsOpacityTransition.Value, 0, 1),
|
||||
});
|
||||
|
||||
if (i == _playingLineIndex)
|
||||
|
||||
Reference in New Issue
Block a user