0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2025-01-09 15:51:59 +00:00

UI: Fix negative space savings in XCI trimmer

This commit is contained in:
Evan Husted 2024-12-25 00:06:29 -06:00
parent 0bacdb8765
commit e6644626fc
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,7 @@
using Avalonia; using Avalonia;
using Avalonia.Data; using Avalonia.Data;
using Avalonia.Data.Converters; using Avalonia.Data.Converters;
using Gommon;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.UI.Common.Models; using Ryujinx.UI.Common.Models;
using System; using System;
@ -32,11 +33,11 @@ namespace Ryujinx.Ava.UI.Helpers
if (app.CurrentSavingsB < app.PotentialSavingsB) if (app.CurrentSavingsB < app.PotentialSavingsB)
{ {
return LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.TitleXCICanSaveLabel, (app.PotentialSavingsB - app.CurrentSavingsB) / _bytesPerMB); return LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.TitleXCICanSaveLabel, ((app.PotentialSavingsB - app.CurrentSavingsB) / _bytesPerMB).CoerceAtLeast(0));
} }
else else
{ {
return LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.TitleXCISavingLabel, app.CurrentSavingsB / _bytesPerMB); return LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.TitleXCISavingLabel, (app.CurrentSavingsB / _bytesPerMB).CoerceAtLeast(0));
} }
} }

View file

@ -364,7 +364,7 @@ namespace Ryujinx.Ava.UI.ViewModels
value = _processingApplication.Value with { PercentageProgress = null }; value = _processingApplication.Value with { PercentageProgress = null };
if (value.HasValue) if (value.HasValue)
_displayedXCIFiles.ReplaceWith(value.Value); _displayedXCIFiles.ReplaceWith(value);
_processingApplication = value; _processingApplication = value;
OnPropertyChanged(); OnPropertyChanged();