修复进度回调done值错误

This commit is contained in:
ww-rm
2025-10-26 23:59:57 +08:00
parent 5498508700
commit 3459f3af03
2 changed files with 4 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ namespace Spine.Exporters
int frameCount = GetFrameCount(); int frameCount = GetFrameCount();
int frameIdx = 0; int frameIdx = 0;
_progressReporter?.Invoke(frameCount, 0, $"[{frameIdx}/{frameCount}] {output}"); // 导出帧序列单独在此处调用进度报告 _progressReporter?.Invoke(frameCount, 0, $"[0/{frameCount}] {output}"); // 导出帧序列单独在此处调用进度报告
foreach (var frame in GetFrames(spines)) foreach (var frame in GetFrames(spines))
{ {
if (ct.IsCancellationRequested) if (ct.IsCancellationRequested)
@@ -37,7 +37,7 @@ namespace Spine.Exporters
var savePath = Path.Combine(output, $"frame_{_fps}_{frameIdx:d6}.png"); var savePath = Path.Combine(output, $"frame_{_fps}_{frameIdx:d6}.png");
var info = new SKImageInfo(frame.Width, frame.Height, SKColorType.Rgba8888, SKAlphaType.Premul); var info = new SKImageInfo(frame.Width, frame.Height, SKColorType.Rgba8888, SKAlphaType.Premul);
_progressReporter?.Invoke(frameCount, frameIdx, $"[{frameIdx + 1}/{frameCount}] {savePath}"); _progressReporter?.Invoke(frameCount, frameIdx + 1, $"[{frameIdx + 1}/{frameCount}] {savePath}");
try try
{ {
using var skImage = SKImage.FromPixelCopy(info, frame.Image.Pixels); using var skImage = SKImage.FromPixelCopy(info, frame.Image.Pixels);

View File

@@ -128,7 +128,7 @@ namespace Spine.Exporters
int frameCount = GetFrameCount(); int frameCount = GetFrameCount();
int frameIdx = 0; int frameIdx = 0;
_progressReporter?.Invoke(frameCount, 0, $"[{frameIdx}/{frameCount}] {output}"); _progressReporter?.Invoke(frameCount, 0, $"[0/{frameCount}] {output}");
foreach (var frame in GetFrames(spines)) foreach (var frame in GetFrames(spines))
{ {
if (ct.IsCancellationRequested) if (ct.IsCancellationRequested)
@@ -138,7 +138,7 @@ namespace Spine.Exporters
break; break;
} }
_progressReporter?.Invoke(frameCount, frameIdx, $"[{frameIdx + 1}/{frameCount}] {output}"); _progressReporter?.Invoke(frameCount, frameIdx + 1, $"[{frameIdx + 1}/{frameCount}] {output}");
yield return frame; yield return frame;
frameIdx++; frameIdx++;
} }