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 single-line fields not scaling fonts #75

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CajunAvenger
Copy link
Collaborator

TextViewer::prepareLinesAtScale has a parameter stop_if_too_long to help it decide when to shrink text, but this is always false for text fields that aren't multi line, so autoshrink fails to apply to them. this PR sets the intial param to true for single line fields so auto-shrink will kick in as long as scale down to is defined.

the instance on line 453 remains false; this is only called when scale down to is not defined so doing the same here would cause text not to render if it overflows, instead it continues the current behavior of squishing text horizontally.

@CajunAvenger
Copy link
Collaborator Author

k issue with this. always-symbol fields ignore the scale down to thing, which means casting cost scales down to fit the tiny box rather than templates extending the tiny box. applied a patch fix where the new fix just skips always-symbol fields, but there's probably a better correction that should be done

@haganbmj
Copy link
Owner

k issue with this. always-symbol fields ignore the scale down to thing, which means casting cost scales down to fit the tiny box rather than templates extending the tiny box. applied a patch fix where the new fix just skips always-symbol fields, but there's probably a better correction that should be done

Good catch and nice find on this in the first place.
I haven't really dug through that area of code much since all the text processing in MSE is pretty custom, so not sure if there's a more specific way to approach this.

I haven't looked at the code in a while so let me try and carve out some time to sit down and poke at it.

@CajunAvenger CajunAvenger marked this pull request as draft May 24, 2024 02:07
@CajunAvenger
Copy link
Collaborator Author

run into another issue where having scale down to on a field is scaling the font down by default, even when it doesn't need to. this occurs without these changes, but i can't find why and kinda undercuts the bug fix. might be over my head after all.

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.

2 participants