Skip to content

Commit f41fec9

Browse files
Make scaling apply directly
1 parent 8ff0fe5 commit f41fec9

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

src/main/java/io/github/ultimateboomer/resolutioncontrol/ResolutionControlMod.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,23 +352,30 @@ public void onResolutionChanged() {
352352
if (getWindow() == null)
353353
return;
354354

355-
LOGGER.debug("Screen size changed to {}x{}",
356-
getWindow().getFramebufferWidth(), getWindow().getFramebufferHeight());
355+
LOGGER.debug("Size changed to {}x{} {}x{} {}x{}",
356+
getWindow().getFramebufferWidth(), getWindow().getFramebufferHeight(),
357+
getWindow().getWidth(), getWindow().getHeight(),
358+
getWindow().getScaledWidth(), getWindow().getScaledHeight());
359+
360+
if (getWindow().getScaledHeight() == lastWidth
361+
|| getWindow().getScaledHeight() == lastHeight)
362+
{
363+
updateFramebufferSize();
364+
365+
lastWidth = getWindow().getScaledHeight();
366+
lastHeight = getWindow().getScaledHeight();
367+
}
368+
357369

358-
updateFramebufferSize();
359370
}
360371

361372
public void updateFramebufferSize() {
362-
if (framebuffer == null || getWindow().getFramebufferWidth() == lastWidth
363-
|| getWindow().getFramebufferHeight() == lastHeight)
373+
if (framebuffer == null)
364374
return;
365375

366376
resize(framebuffer);
367377
resizeMinecraftFramebuffers();
368378

369-
lastWidth = getWindow().getFramebufferWidth();
370-
lastHeight = getWindow().getFramebufferHeight();
371-
372379
calculateSize();
373380
}
374381

0 commit comments

Comments
 (0)