Enhance scaling checks for framebuffer and window
Add additional checks for render dimensions to prevent scaling issues.
This commit is contained in:
parent
8f7ee9ee10
commit
7a4eb2d54c
|
|
@ -1880,7 +1880,8 @@ static void FramebufferSizeCallback(GLFWwindow *window, int width, int height)
|
||||||
// Update scaling/mouse mapping based on actual framebuffer-to-window ratio
|
// Update scaling/mouse mapping based on actual framebuffer-to-window ratio
|
||||||
// (this avoids blurry scaling by rendering at framebuffer resolution while
|
// (this avoids blurry scaling by rendering at framebuffer resolution while
|
||||||
// keeping logical coordinates stable).
|
// keeping logical coordinates stable).
|
||||||
if ((CORE.Window.screen.width > 0) && (CORE.Window.screen.height > 0))
|
if ((CORE.Window.screen.width > 0) && (CORE.Window.screen.height > 0) &&
|
||||||
|
(CORE.Window.render.width > 0) && (CORE.Window.render.height > 0))
|
||||||
{
|
{
|
||||||
const float sx = (float)CORE.Window.render.width/(float)CORE.Window.screen.width;
|
const float sx = (float)CORE.Window.render.width/(float)CORE.Window.screen.width;
|
||||||
const float sy = (float)CORE.Window.render.height/(float)CORE.Window.screen.height;
|
const float sy = (float)CORE.Window.render.height/(float)CORE.Window.screen.height;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user