mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Round image resize values
This commit is contained in:
parent
db98bf7321
commit
40afd4a59f
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue