Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #6481 added scaling ability to VFonts but got lucking in its clipping checks in that almost all
gr_string()
calls occur while the clip region is set to the screen size. There are a few edge cases that set the clip region to a specific bounding box. So we have to do our clipping checks before we do the coordinate offsets.Took the opportunity to just cleanup the
gr_string_old()
function a touch while I was at it again; moved variable declarations to where they are actually used.Fixes #6531
I'll add that I did a full dive into the original clipping code that was present and have again concluded it's not necessary. Much of it was intended to display only partial characters if part of the character was clipped. It would do this by adjusting the UV coordinates from which to get the character bitmap to display. However, the rendering code seems to do this clipping automatically so that's unnecessary. An easy way to see this in action is to add
+Can Scale: true
to the default fonts.tbl and set your font scale to something larger like 2.0. Then go to the pilot select screen and create a pilot. While typing the name you'll see the characters are cutoff at the bottom clip border without any of the special code in place to get partial character UV coordinates. I can only conclude that sometime between when Volition wrote this function and now, one of our rendering upgrades took over this task.