Round image resize values

This commit is contained in:
Jaex 2018-02-12 16:12:26 +03:00
parent db98bf7321
commit 40afd4a59f
2 changed files with 4 additions and 4 deletions

View file

@ -207,11 +207,11 @@ public static Image ResizeImageLimit(Image img, int width, int height)
if (ratioX < ratioY)
{
height = (int)(img.Height * ratioX);
height = (int)Math.Round(img.Height * ratioX);
}
else if (ratioX > ratioY)
{
width = (int)(img.Width * ratioY);
width = (int)Math.Round(img.Width * ratioY);
}
return ResizeImage(img, width, height);

View file

@ -67,10 +67,10 @@ private void OpenStickerForm(bool creating)
{
Image img = ImageHelpers.LoadImage(stickerForm.SelectedImageFile);
img = ImageHelpers.ResizeImageLimit(img, stickerForm.StickerSize);
if (img != null)
{
img = ImageHelpers.ResizeImageLimit(img, stickerForm.StickerSize);
SetImage(img, true);
if (creating)