File tree Expand file tree Collapse file tree
src/main/java/io/github/ultimateboomer/resolutioncontrol Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments