Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: maximum size isn't respected correctly when aspect ratio is enabled #29100

Closed
3 tasks done
CezaryKulakowski opened this issue May 11, 2021 · 1 comment · Fixed by #29101
Closed
3 tasks done

Comments

@CezaryKulakowski
Copy link
Contributor

CezaryKulakowski commented May 11, 2021

Preflight Checklist

Electron Version

14.0.0-nightly.20210507

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

don't know

Steps to reproduce

  1. Launch following application:
const { app, BrowserWindow } = require('electron')

function startTest() {
  let win = new BrowserWindow({
    width: 200,
    height: 200,
    minWidth: 100,
    maxWidth: 300,
    minHeight: 100,
    maxHeight:300
  });
  win.webContents.loadURL('https://www.example.com');
  win.setAspectRatio(1.0);
}

app.on('ready', startTest)
  1. Resize window to maximum size.

Expected Behavior

Maximum size is correctly respected also when aspect ratio is enabled.

Actual Behavior

It's not possible to resize window to maximum size. Also aspect ratio is not respected (width != height). Additionally there is a DCHECK in Testing build:

[24772:0511/131301.276:FATAL:resize_utils.cc(44)] Check failed: Rect(rect->origin(), max_window_size).Contains(*rect). 860,420 256x250 is larger than the maximum size 284x241

Testcase Gist URL

No response

Additional Information

No response

@CezaryKulakowski
Copy link
Contributor Author

I've created pr with fix for this issue: #29101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants