Skip to content

Commit

Permalink
Fix reset feed/notification filters, fix print uploads being cropped …
Browse files Browse the repository at this point in the history
…still
  • Loading branch information
Natsumi-sama committed Dec 30, 2024
1 parent e719aee commit 0e93e4a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions Dotnet/AppApi/AppApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,21 @@ public byte[] ResizePrintImage(byte[] imageData)
var newWidth = image.Width;
if (image.Width < desiredWidth)
{
newWidth = desiredWidth;
newHeight = (int)Math.Round(image.Height / (image.Width / (double)newWidth));
var testHeight = (int)Math.Round(image.Height / (image.Width / (double)desiredWidth));
if (testHeight <= desiredHeight)
{
newWidth = desiredWidth;
newHeight = testHeight;
}
}
if (image.Height < desiredHeight)
{
newHeight = desiredHeight;
newWidth = (int)Math.Round(image.Width / (image.Height / (double)newHeight));
var testWidth = (int)Math.Round(image.Width / (image.Height / (double)desiredHeight));
if (testWidth <= desiredWidth)
{
newHeight = desiredHeight;
newWidth = testWidth;
}
}
var resizedImage = new Bitmap(desiredWidth, desiredHeight);
using var graphics1 = Graphics.FromImage(resizedImage);
Expand Down
8 changes: 4 additions & 4 deletions html/src/classes/sharedFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,18 +579,18 @@ export default class extends baseClass {
this.updateSharedFeed(true);
},

async resetNotyFeedFilters(){
async resetNotyFeedFilters() {
this.sharedFeedFilters.noty = {
...this.sharedFeedFiltersDefaults.noty
};
await configRepository.setString('sharedFeedFilters', JSON.stringify(this.sharedFeedFiltersDefaults));
this.saveSharedFeedFilters();
},

async resetWristFeedFilters(){
async resetWristFeedFilters() {
this.sharedFeedFilters.wrist = {
...this.sharedFeedFiltersDefaults.wrist
};
await configRepository.setString('sharedFeedFilters', JSON.stringify(this.sharedFeedFiltersDefaults));
this.saveSharedFeedFilters();
}
};
}

0 comments on commit 0e93e4a

Please sign in to comment.