mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 10:54:55 +08:00
fix
This commit is contained in:
@@ -45,7 +45,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
}
|
||||
else
|
||||
{
|
||||
_easingType = EasingType.EaseInOutSine;
|
||||
_easingType = EasingType.Linear;
|
||||
_interpolator = GetInterpolatorByEasingType(_easingType.Value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ using Microsoft.Graphics.Canvas;
|
||||
using Microsoft.Graphics.Canvas.Geometry;
|
||||
using Microsoft.Graphics.Canvas.Text;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using Windows.UI;
|
||||
@@ -88,9 +86,9 @@ namespace BetterLyrics.WinUI3.Models
|
||||
return;
|
||||
}
|
||||
BackgroundFontEffect = new CanvasCommandList(control);
|
||||
var bgFontEffectDs = BackgroundFontEffect.CreateDrawingSession();
|
||||
using var bgFontEffectDs = BackgroundFontEffect.CreateDrawingSession();
|
||||
ForegroundFontEffect = new CanvasCommandList(control);
|
||||
var fgFontEffectDs = ForegroundFontEffect.CreateDrawingSession();
|
||||
using var fgFontEffectDs = ForegroundFontEffect.CreateDrawingSession();
|
||||
if (drawStroke)
|
||||
{
|
||||
bgFontEffectDs.DrawGeometry(TextGeometry, Position, strokeColor, strokeWidth); // 描边
|
||||
|
||||
@@ -3,15 +3,9 @@ using Microsoft.Graphics.Canvas;
|
||||
using Microsoft.Graphics.Canvas.Effects;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics.Effects;
|
||||
|
||||
namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
@@ -70,9 +64,8 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
float cornerRadius = _albumArtCornerRadius / 100f * _albumArtSize / 2;
|
||||
|
||||
// TODO 当前未监听专辑封面圆角变化
|
||||
var cornerRadiusMask = new CanvasCommandList(control);
|
||||
var cornerRadiusMaskDs = cornerRadiusMask.CreateDrawingSession();
|
||||
using var cornerRadiusMaskDs = cornerRadiusMask.CreateDrawingSession();
|
||||
cornerRadiusMaskDs.FillRoundedRectangle(
|
||||
new Rect(0, 0, imageWidth * scaleFactor, imageHeight * scaleFactor),
|
||||
cornerRadius, cornerRadius, Colors.White
|
||||
@@ -98,8 +91,8 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
_albumArtBgEffect?.Dispose();
|
||||
_albumArtBgEffect = null;
|
||||
|
||||
var overlappedCovers = new CanvasCommandList(control);
|
||||
var overlappedCoversDs = overlappedCovers.CreateDrawingSession();
|
||||
using var overlappedCovers = new CanvasCommandList(control);
|
||||
using var overlappedCoversDs = overlappedCovers.CreateDrawingSession();
|
||||
|
||||
if (_lastBgImageEffect != null && !_lastBgImageEffect.IsDisposed() && _lastAlbumArtCanvasBitmap != null)
|
||||
{
|
||||
@@ -110,7 +103,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
DrawBackgroundImgae(_bgImageEffect, overlappedCoversDs, _albumArtCanvasBitmap);
|
||||
}
|
||||
|
||||
var blurredCover = new GaussianBlurEffect
|
||||
using var blurredCover = new GaussianBlurEffect
|
||||
{
|
||||
BlurAmount = _albumArtBgBlurAmount,
|
||||
Source = overlappedCovers,
|
||||
@@ -118,8 +111,8 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
Optimization = EffectOptimization.Speed,
|
||||
};
|
||||
|
||||
var combined = new CanvasCommandList(control);
|
||||
var combinedDs = combined.CreateDrawingSession();
|
||||
using var combined = new CanvasCommandList(control);
|
||||
using var combinedDs = combined.CreateDrawingSession();
|
||||
|
||||
if (_coverAcrylicEffectAmount > 0 && _coverAcrylicNoiseCanvasBitmap != null)
|
||||
{
|
||||
@@ -141,7 +134,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
|
||||
_albumArtBgEffect = new CanvasCommandList(control);
|
||||
var albumArtBgDs = _albumArtBgEffect.CreateDrawingSession();
|
||||
using var albumArtBgDs = _albumArtBgEffect.CreateDrawingSession();
|
||||
albumArtBgDs.DrawImage(new OpacityEffect
|
||||
{
|
||||
Opacity = _albumArtBgOpacity / 100f,
|
||||
|
||||
@@ -37,22 +37,26 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private readonly ValueTransition<float> _titleXTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.3f
|
||||
durationSeconds: 0.3f,
|
||||
easingType: EasingType.EaseInOutBack
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _titleYTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.3f
|
||||
durationSeconds: 0.3f,
|
||||
easingType: EasingType.EaseInOutBack
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _lyricsXTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.3f
|
||||
durationSeconds: 0.3f,
|
||||
easingType: EasingType.EaseInOutBack
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _lyricsYTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.3f
|
||||
durationSeconds: 0.3f,
|
||||
easingType: EasingType.EaseInOutBack
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _lyricsOpacityTransition = new(
|
||||
@@ -72,12 +76,14 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private readonly ValueTransition<float> _albumArtXTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.3f
|
||||
durationSeconds: 0.3f,
|
||||
easingType: EasingType.EaseInOutBack
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _albumArtYTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.3f
|
||||
durationSeconds: 0.3f,
|
||||
easingType: EasingType.EaseInOutBack
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _songInfoOpacityTransition = new(
|
||||
|
||||
Reference in New Issue
Block a user