Skip to content

Fix game background stretching at odd aspect ratios

Joshua Goins requested to merge work/redstrate/fix-background-centering into master

Currently, the game background stretches instead of keeping the original aspect ratio the theme was authored for.

image

With this MR, it now makes sure the original aspect ratio is preserved:

image

I assumed that most theme backgrounds would work better in the very center.

Now the easiest solution would be to use QtSvgRenderer's function to preserve aspect ratio, but it doesn't support PreserveAspectRatioByExpanding so I needed to fiddle with the bounds instead. This is already denoted in the comments.

Also note that there's an unrelated bug affecting the background not properly resizing on change, until a new game is started - so please keep that in mind when testing :-)

Merge request reports