Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • KBlocks KBlocks
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GamesGames
  • KBlocksKBlocks
  • Merge requests
  • !18

Fix game background stretching at odd aspect ratios

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Joshua Goins requested to merge work/redstrate/fix-background-centering into master Jan 11, 2023
  • Overview 14
  • Commits 2
  • Pipelines 9
  • Changes 6

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 :-)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/redstrate/fix-background-centering