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

[Feature Request]: Accept decimal width/hight for BrowserWindow #42222

Closed
3 tasks done
6km opened this issue May 17, 2024 · 2 comments
Closed
3 tasks done

[Feature Request]: Accept decimal width/hight for BrowserWindow #42222

6km opened this issue May 17, 2024 · 2 comments

Comments

@6km
Copy link

6km commented May 17, 2024

Preflight Checklist

Electron Version

30.0.1

What operating system are you using?

Windows

Operating System Version

Windows 10 version 22H2 (OS build 19045.4291)

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

It should set width/height to the exact number; or at least the nearest number.

Actual Behavior

It falls back to the default value of the property that has a decimal number.

Testcase Gist URL

No response

Additional Information

It just doesn't respect the decimal number.
As example, if the width of the BrowserWindow is set to 3.14, it uses the default value; which is 800.

@Nantris
Copy link
Contributor

Nantris commented May 18, 2024

This is not a bug; it's a feature request. As it stands, you owe Electron a whole-pixel value here and it's your job to round it.

@clavin clavin changed the title [Bug]: Decimal width and height not respected [Feature Request]: Accept decimal width/hight for BrowserWindow May 21, 2024
@codebytere
Copy link
Member

This was actually addressed as a side effect of #42056 - as of this PR, you can pass in double values and they will be rounded to the nearest number and set to that.

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

No branches or pull requests

4 participants