diff options
author | daPhie79 <33412188+daPhie79@users.noreply.github.com> | 2017-11-18 05:05:18 +0300 |
---|---|---|
committer | daPhie79 <33412188+daPhie79@users.noreply.github.com> | 2017-11-18 05:05:18 +0300 |
commit | 1439d063640793f2165513d6fda421f33378fdf3 (patch) | |
tree | 22f0cd0f2a86dd25fbdc1610ceaec0f28ffe8508 /Apps | |
parent | f95dfc0e02610fecb5981120d121ab7b4626a8ac (diff) |
keep cover art image height an even number to avoid transparency issues on snesc
Diffstat (limited to 'Apps')
-rw-r--r-- | Apps/NesMiniApplication.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Apps/NesMiniApplication.cs b/Apps/NesMiniApplication.cs index 33f59573..8c8ac715 100644 --- a/Apps/NesMiniApplication.cs +++ b/Apps/NesMiniApplication.cs @@ -417,14 +417,24 @@ namespace com.clusterrr.hakchi_gui maxY = 204;
}
if ((double)image.Width / (double)image.Height > (double)maxX / (double)maxY)
- outImage = new Bitmap(maxX, (int)((double)maxX * (double)image.Height / (double)image.Width));
+ {
+ int Y = (int)((double)maxX * (double)image.Height / (double)image.Width);
+ if (Y % 2 == 1)
+ ++Y;
+ outImage = new Bitmap(maxX, Y);
+ }
else
outImage = new Bitmap((int)(maxY * (double)image.Width / (double)image.Height), maxY);
int maxXsmall = 40;
int maxYsmall = 40;
if ((double)image.Width / (double)image.Height > (double)maxXsmall / (double)maxYsmall)
- outImageSmall = new Bitmap(maxXsmall, (int)((double)maxXsmall * (double)image.Height / (double)image.Width));
+ {
+ int Y = (int)((double)maxXsmall * (double)image.Height / (double)image.Width);
+ if (Y % 2 == 1)
+ ++Y;
+ outImageSmall = new Bitmap(maxXsmall, Y);
+ }
else
outImageSmall = new Bitmap((int)(maxYsmall * (double)image.Width / (double)image.Height), maxYsmall);
|