Small fix for to small sized textures

This commit is contained in:
Flamefire committed 2013-05-02 03:20:25 +02:00
1 parent ac8a53fc55
commit 8df0668039
2 files changed
+8

No files matched your search

+4
View File
@@ -886,11 +886,15 @@ namespace Vocaluxe.Lib.Draw
{
w = newW;
h = (int)Math.Round(w / ratio);
if (h == 0)
h = 1;
}
else
{
h = newH;
w = (int)Math.Round(h * ratio);
if (w == 0)
w = 1;
}
//Create a new Bitmap with the new sizes
bmp2 = new Bitmap(w, h);
+4
View File
@@ -713,12 +713,16 @@ namespace Vocaluxe.Lib.Draw
if (w > maxSize)
{
h = (int)Math.Round((float)maxSize / bmp.Width * bmp.Height);
if (h == 0)
h = 1;
w = maxSize;
}
if (h > maxSize)
{
w = (int)Math.Round((float)maxSize / bmp.Height * bmp.Width);
if (w == 0)
w = 1;
h = maxSize;
}