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: Fancy Button Content Fitting #149

Merged
merged 6 commits into from
Apr 15, 2024
Merged

Conversation

bbazukun123
Copy link
Collaborator

@bbazukun123 bbazukun123 commented Mar 22, 2024

  • Reset text/icon view scaling back to the default scale before doing the fitToView call to prevent the persistent of scale < 1 from the initial fitting.
    eg. if the button default view texture has a width of 150 and the content text has a width of 200, it will apply 0.75 scaling to the text view to fit it within the button (assuming that the padding is 0). Then if the button width is then set to 250, the text will still remain at 0.75 despite that it no longer needed to be scaled down to fit within the button.
  • A ignoreRefitting is provided in case the persistent scaling behaviour from before is preferred.
  • Add the ability to pass in the base scale for text and icon at instantiation. This will be prioritise over the automatic extraction from the new text or icon views.
  • Add the ability to disable uniform scaling on the fitToView function to allow the child to maintain its aspect ratio from before the fitting.

@Zyie Zyie force-pushed the fix/fancy-button-content-fitting branch from b9d1810 to c84a6e2 Compare April 4, 2024 09:56
@Zyie Zyie changed the title Fix: Adjust Fancy Button Content Fitting Fix: Fancy Button Content Fitting Apr 4, 2024
@Zyie Zyie merged commit 9069cea into v1.x Apr 15, 2024
5 checks passed
@Zyie Zyie deleted the fix/fancy-button-content-fitting branch April 15, 2024 10:18
Zyie added a commit that referenced this pull request May 22, 2024
Co-authored-by: Baz Utsahajit <[email protected]>
Co-authored-by: Zyie <[email protected]>
Fix: Fancy Button Content Fitting (#149)
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