fix size of non-outlined labels #234
Open
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.
The new version was always adding room for an outline to the Bitmap even when one wasn't used. My thought at the time was that an accent could be added at any time using an outline so it should pre-allocate the padding space for it.
But adding that extra padding means that all non-outlined text got shifted slightly, and had a larger background box size than before (if background is visible). It was only 1px by default, but now I think it's best to not have it shift at all, and if possible have the same default background box size as before when outlines aren't in use.
This change does that by only setting padding if outline is in use. When new accents get added, if they are outline accents, the padding will be adjusted as needed. I've also added the usage of
max()so that if the user had manually specified a padding that was large enough then it won't be changed.I also removed the hardcoded
+2from padding bottom I'm not entirely sure why that was there before. Perhaps it was an attempt to account for decenders, but those seem to still work as expected without that extra space. It along with superfluous+ 0s are removed.With this version non-outlined text is now the same size and position as it was before the recent change.