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

feat: make win.setAspectRatio() work on Windows #26941

Merged
merged 2 commits into from Jan 5, 2021

Conversation

zcbenz
Copy link
Member

@zcbenz zcbenz commented Dec 11, 2020

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

Release Notes

Notes: Make win.setAspectRatio() work on Windows.

@zcbenz zcbenz added semver/minor backwards-compatible functionality api-review/requested 🗳 labels Dec 11, 2020
@zcbenz zcbenz requested a review from a team as a code owner December 11, 2020 05:14
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Dec 11, 2020
Copy link
Member

@samuelmaddock samuelmaddock left a 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. 🙂

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Dec 18, 2020
@zcbenz zcbenz merged commit 5f99569 into master Jan 5, 2021
@release-clerk
Copy link

release-clerk bot commented Jan 5, 2021

Release Notes Persisted

Make win.setAspectRatio() work on Windows.

@zcbenz zcbenz deleted the windows-win-aspect-ratio branch January 5, 2021 08:17
@samuelmaddock
Copy link
Member

@electron/wg-releases @zcbenz I'm interested in seeing this work in 11.x.y. Any chance we could get it backported?

@zcbenz
Copy link
Member Author

zcbenz commented Jan 6, 2021

/trop run backport

@trop
Copy link
Contributor

trop bot commented Jan 6, 2021

The backport process for this PR has been manually initiated, here we go! :D

@trop
Copy link
Contributor

trop bot commented Jan 6, 2021

I have automatically backported this PR to "12-x-y", please check out #27202

@trop
Copy link
Contributor

trop bot commented Jan 6, 2021

I have automatically backported this PR to "11-x-y", please check out #27203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/approved ✅ semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce a aspect ratio when resizing for Windows
5 participants