Fixed a bug I introduced ;)

This commit is contained in:
jme9
2025-03-18 20:45:31 -07:00
parent d50de67f82
commit 0e60bb4207
3 changed files with 12 additions and 20 deletions
+6 -5
View File
@@ -12,8 +12,8 @@ namespace LunaLightXMG
private RenderTarget2D renderTarget;
private Rectangle renderDestination;
private float retroWidth;
private float retroHeight;
private readonly float retroWidth;
private readonly float retroHeight;
private float zoomLevel = 1.0f;
private float zoomTarget = 1.0f;
private readonly float zoomMin = 0.50f;
@@ -71,10 +71,11 @@ namespace LunaLightXMG
// Calculate the integer scale factor
float scaleX = screenSize.X / (retroWidth * zoomLevel);
float scaleY = screenSize.Y / (retroHeight * zoomLevel);
float scale = Math.Min(scaleX, scaleY);
// Set renderDestination
renderDestination.Width = (int)(retroWidth * scaleX);
renderDestination.Height = (int)(retroHeight * scaleY);
renderDestination.Width = (int)(retroWidth * scale);
renderDestination.Height = (int)(retroHeight * scale);
renderDestination.X = (screenSize.X - renderDestination.Width) / 2;
renderDestination.Y = (screenSize.Y - renderDestination.Height) / 2;
}