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

Fix #10660: Sprite Font scale affected by viewport zoom level limits. #10668

Merged
merged 1 commit into from
Apr 16, 2023

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Apr 16, 2023

Motivation / Problem

The maximum viewport zoom level setting inadvertently affects the scaled sprite font, since with variable interface scaling all the font_zoom related variables were merged with gui_zoom.

This issue does not affect scaleable fonts, only the built-in sprite font.

image

Description

Add separate _font_zoom which is only used to scale the sprite font. This is not clamped to the viewport zoom level limits, so always follows interface scale.

image

Limitations

Non-font sprites are still limited to the viewport zoom level, even when shown in a GUI. This is because there's currently no differentiation between viewport sprites and gui sprites, and also some sprites are used in both locations.

Could possibly be done but I think it's separate to this.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

…limits.

Add separate _font_zoom which is only used to scale the sprite font. This is not clamped to the viewport zoom level limits, so always follows interface scale.
Copy link
Contributor

@rubidium42 rubidium42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely a step in the right direction.

@michicc michicc merged commit db573c8 into OpenTTD:master Apr 16, 2023
18 checks passed
@PeterN PeterN deleted the fixish-10660 branch April 16, 2023 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants