From 8df066803900f046e0fa6143b846d3e8a7c57925 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Thu, 2 May 2013 03:20:25 +0200 Subject: [PATCH] Small fix for to small sized textures --- Vocaluxe/Lib/Draw/CDirect3D.cs | 4 ++++ Vocaluxe/Lib/Draw/COpenGL.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 535da199..f1b0b6bc 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -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); diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index a0553a34..b866787c 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -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; }