Fix reset feed/notification filters, fix print uploads being cropped still

This commit is contained in:
Natsumi
2024-12-30 16:45:59 +13:00
parent e719aee044
commit 0e93e4ac7e
2 changed files with 16 additions and 8 deletions
+12 -4
View File
@@ -154,13 +154,21 @@ namespace VRCX
var newWidth = image.Width; var newWidth = image.Width;
if (image.Width < desiredWidth) if (image.Width < desiredWidth)
{ {
newWidth = desiredWidth; var testHeight = (int)Math.Round(image.Height / (image.Width / (double)desiredWidth));
newHeight = (int)Math.Round(image.Height / (image.Width / (double)newWidth)); if (testHeight <= desiredHeight)
{
newWidth = desiredWidth;
newHeight = testHeight;
}
} }
if (image.Height < desiredHeight) if (image.Height < desiredHeight)
{ {
newHeight = desiredHeight; var testWidth = (int)Math.Round(image.Width / (image.Height / (double)desiredHeight));
newWidth = (int)Math.Round(image.Width / (image.Height / (double)newHeight)); if (testWidth <= desiredWidth)
{
newHeight = desiredHeight;
newWidth = testWidth;
}
} }
var resizedImage = new Bitmap(desiredWidth, desiredHeight); var resizedImage = new Bitmap(desiredWidth, desiredHeight);
using var graphics1 = Graphics.FromImage(resizedImage); using var graphics1 = Graphics.FromImage(resizedImage);
+4 -4
View File
@@ -579,18 +579,18 @@ export default class extends baseClass {
this.updateSharedFeed(true); this.updateSharedFeed(true);
}, },
async resetNotyFeedFilters(){ async resetNotyFeedFilters() {
this.sharedFeedFilters.noty = { this.sharedFeedFilters.noty = {
...this.sharedFeedFiltersDefaults.noty ...this.sharedFeedFiltersDefaults.noty
}; };
await configRepository.setString('sharedFeedFilters', JSON.stringify(this.sharedFeedFiltersDefaults)); this.saveSharedFeedFilters();
}, },
async resetWristFeedFilters(){ async resetWristFeedFilters() {
this.sharedFeedFilters.wrist = { this.sharedFeedFilters.wrist = {
...this.sharedFeedFiltersDefaults.wrist ...this.sharedFeedFiltersDefaults.wrist
}; };
await configRepository.setString('sharedFeedFilters', JSON.stringify(this.sharedFeedFiltersDefaults)); this.saveSharedFeedFilters();
} }
}; };
} }