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
feat: make win.setAspectRatio() work on Windows #26941
Conversation
5e95e83
to
7c7151d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM.
A test might be nice for the aspect ratio of 0 edge case to ensure the patch continues to work. I noticed the part of the description about this. 🙂
7c7151d
to
b5e4f83
Compare
b5e4f83
to
0a54b54
Compare
Release Notes Persisted
|
@electron/wg-releases @zcbenz I'm interested in seeing this work in 11.x.y. Any chance we could get it backported? |
/trop run backport |
The backport process for this PR has been manually initiated, here we go! :D |
I have automatically backported this PR to "12-x-y", please check out #27202 |
I have automatically backported this PR to "11-x-y", please check out #27203 |
Description of Change
Close #8036.
This PR makes
win.setAspectRatio
work on Windows. It didn't work previously because the Windows implementation requires a non-zero maximum size, while we provided (0, 0) when maximum size is not set.There is also a patch added to allow setting aspect ratio to 0 on Windows.
I'm unable to write a test for this because the aspect ratio is not respected when window is resized programmingly with APIs like
win.setSize
, it is also why we did not have a test for it at the first place.Checklist
npm test
passesRelease Notes
Notes: Make
win.setAspectRatio()
work on Windows.