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

Have WindowPosition::Centered take scale_factor_override into account #13949

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

MScottMcBee
Copy link
Contributor

Objective

Fixes #8916

My game has a low resolution pixel art style, and I use .with_scale_factor_override() to make the window larger. WindowPosition::Centered doesn't work for me.

Solution

If scale_factor_override is set, use that over monitor.scale_factor

Testing

Tested on Windows 11 with an Nvidia GPU:

Main

image

This PR

image

Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Windowing Platform-agnostic interface layer to run your app in S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 20, 2024
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 20, 2024
@mockersf mockersf added this pull request to the merge queue Jun 24, 2024
Merged via the queue into bevyengine:main with commit d48ebdf Jun 24, 2024
32 checks passed
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 26, 2024
mockersf pushed a commit that referenced this pull request Jun 26, 2024
…#13949)

# Objective

Fixes #8916 

My game has a low resolution pixel art style, and I use
`.with_scale_factor_override()` to make the window larger.
`WindowPosition::Centered` doesn't work for me.

## Solution

If `scale_factor_override` is set, use that over `monitor.scale_factor`

## Testing

Tested on Windows 11 with an Nvidia GPU:

### Main

![image](https://github.com/bevyengine/bevy/assets/3324533/5f9ae90e-b65a-48d9-b601-117df8f08a28)

### This PR

![image](https://github.com/bevyengine/bevy/assets/3324533/cd860611-7b6a-4ae5-b690-28d9ba8ea6ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Centering windows doesn't take scale_factor_override into account
4 participants