Skip to content

Conversation

@Jettcodey
Copy link

Hey! I've made small additions to add auto font scaling to REPOLabel so text stays within bounds and no longer runs "off-screen" in REPOConfig, maybe i should've made a pr with these changes to that Repository instead, i hope its okay i did it here.
(this annoyed me alot).

Changes:

  • Added minFontSize, maxFontSize, and an autoScaleToFit toggle
  • Implemented ScaleFontToFit() to adjust font size based on available width
  • Added a SetText() helper with optional scaling

Let me know if there are any issues with this i missed, but it worked as i intended it to (see example images).

I know enableAutoSizing exists, but its scaling tends to be too aggressive (imo), which is why I went with this approach instead.

Before:
image

After:
image

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.

1 participant