修复导出单个模式的时长错误

This commit is contained in:
ww-rm
2025-07-25 13:50:36 +08:00
parent e717eab6df
commit ca34494483
3 changed files with 5 additions and 5 deletions

View File

@@ -92,7 +92,7 @@ namespace SpineViewer.ViewModels.Exporters
var output = Path.Combine(_outputDir!, filename); var output = Path.Combine(_outputDir!, filename);
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines); if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max(); exporter.Duration = _duration >= 0 ? _duration : spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
exporter.ProgressReporter = (total, done, text) => exporter.ProgressReporter = (total, done, text) =>
{ {

View File

@@ -83,7 +83,7 @@ namespace SpineViewer.ViewModels.Exporters
var output = Path.Combine(_outputDir!, filename); var output = Path.Combine(_outputDir!, filename);
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines); if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max(); exporter.Duration = _duration >= 0 ? _duration : spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
exporter.ProgressReporter = (total, done, text) => exporter.ProgressReporter = (total, done, text) =>
{ {

View File

@@ -56,12 +56,12 @@ namespace SpineViewer.ViewModels.Exporters
var output = Path.Combine(_outputDir!, folderName); var output = Path.Combine(_outputDir!, folderName);
if (_autoResolution) SetAutoResolutionAnimated(exporter, spines); if (_autoResolution) SetAutoResolutionAnimated(exporter, spines);
if (_duration < 0) exporter.Duration = spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max(); exporter.Duration = _duration >= 0 ? _duration : spines.Select(sp => sp.GetAnimationMaxDuration()).DefaultIfEmpty(0).Max();
exporter.ProgressReporter = (total, done, text) => exporter.ProgressReporter = (total, done, text) =>
{ {
pr.Total = total; pr.Total = total;
pr.Done = done; pr.Done = done;
pr.ProgressText = text; pr.ProgressText = text;
_vmMain.ProgressValue = pr.Done / pr.Total; _vmMain.ProgressValue = pr.Done / pr.Total;
}; };