Merge branch 'Better_Graphics_Handling' into develop
Conflicts: Vocaluxe/Base/CBackgroundMusic.cs Vocaluxe/Base/CCover.cs Vocaluxe/Base/CDataBase.cs Vocaluxe/Base/CDraw.cs Vocaluxe/Base/CMain.cs Vocaluxe/Base/CProfiles.cs Vocaluxe/Base/CTheme.cs Vocaluxe/Base/CVideo.cs Vocaluxe/Base/CWebcam.cs Vocaluxe/Base/Fonts/CFont.cs Vocaluxe/Base/Fonts/CGlyph.cs Vocaluxe/Lib/Draw/CDirect3D.cs Vocaluxe/Lib/Draw/CDrawWinForm.cs Vocaluxe/Lib/Draw/COpenGL.cs Vocaluxe/Lib/Draw/IDraw.cs Vocaluxe/Lib/Video/CVideoDecoder.cs Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs Vocaluxe/Lib/Video/IVideoDecoder.cs Vocaluxe/Lib/Webcam/CAForgeNet.cs Vocaluxe/Lib/Webcam/IWebcam.cs Vocaluxe/Screens/CScreenCredits.cs Vocaluxe/Screens/CScreenNames.cs Vocaluxe/Screens/CScreenOptionsVideo.cs Vocaluxe/Screens/CScreenProfiles.cs Vocaluxe/Screens/CScreenSing.cs VocaluxeLib/Menu/IMenu.cs VocaluxeLib/Songs/CCategory.cs VocaluxeLib/Songs/CSong.cs VocaluxeLib/Structs.cs VocaluxeLib/VocaluxeLib.csproj
This commit is contained in:
commit
9d13c32b93
56 files changed
+1579
-1772
No files matched your search
+18
-21
@@ -91,9 +91,9 @@ namespace VocaluxeLib
|
||||
|
||||
public static void SetRect(RectangleF bounds, out RectangleF rect, float rectAspect, EAspect aspect)
|
||||
{
|
||||
float rW = bounds.Right - bounds.Left;
|
||||
float rH = bounds.Bottom - bounds.Top;
|
||||
float rA = rW / rH;
|
||||
float boundsW = bounds.Width;
|
||||
float boundsH = bounds.Height;
|
||||
float boundsAspect = boundsW / boundsH;
|
||||
|
||||
float scaledWidth;
|
||||
float scaledHeight;
|
||||
@@ -101,42 +101,39 @@ namespace VocaluxeLib
|
||||
switch (aspect)
|
||||
{
|
||||
case EAspect.Crop:
|
||||
if (rA >= rectAspect)
|
||||
if (boundsAspect >= rectAspect)
|
||||
{
|
||||
scaledWidth = rW;
|
||||
scaledHeight = rH * rA / rectAspect;
|
||||
scaledWidth = boundsW;
|
||||
scaledHeight = boundsW / rectAspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
scaledHeight = rH;
|
||||
scaledWidth = rW * rectAspect / rA;
|
||||
scaledHeight = boundsH;
|
||||
scaledWidth = boundsH * rectAspect;
|
||||
}
|
||||
break;
|
||||
case EAspect.LetterBox:
|
||||
if (rectAspect >= 1)
|
||||
if (boundsAspect <= rectAspect)
|
||||
{
|
||||
scaledWidth = rW;
|
||||
scaledHeight = rH * rA / rectAspect;
|
||||
scaledWidth = boundsW;
|
||||
scaledHeight = boundsW / rectAspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
scaledHeight = rH;
|
||||
scaledWidth = rW * rectAspect / rA;
|
||||
scaledHeight = boundsH;
|
||||
scaledWidth = boundsH * rectAspect;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
scaledWidth = rW;
|
||||
scaledHeight = rH;
|
||||
scaledWidth = boundsW;
|
||||
scaledHeight = boundsH;
|
||||
break;
|
||||
}
|
||||
|
||||
float left = (rW - scaledWidth) / 2 + bounds.Left;
|
||||
float rigth = left + scaledWidth;
|
||||
float left = (boundsW - scaledWidth) / 2 + bounds.Left;
|
||||
float upper = (boundsH - scaledHeight) / 2 + bounds.Top;
|
||||
|
||||
float upper = (rH - scaledHeight) / 2 + bounds.Top;
|
||||
float lower = upper + scaledHeight;
|
||||
|
||||
rect = new RectangleF(left, upper, rigth - left, lower - upper);
|
||||
rect = new RectangleF(left, upper, scaledWidth, scaledHeight);
|
||||
}
|
||||
|
||||
public static List<string> ListFiles(string path, string cast, bool recursive = false, bool fullpath = false)
|
||||
|
||||
Reference in new issue
Block a user