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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 76] Add maximumScaleFactor to Typography #81

Merged
merged 1 commit into from Mar 30, 2023

Conversation

mpospese
Copy link
Contributor

Introduction

We support setting a maximum scale factor on individual UI elements (buttons, labels, text fields, etc.) but not at the Typography label. If there is an app-wide requirement for a given maximum scale factor (e.g. 2.5) then it would be onerous to apply because every single label, button, etc would need to set that maximum scale factor. It might be nice to be able to set this at the Typography level and then it would apply to every UI element that makes use of that Typography.

Purpose

Fix #76 Add maximumScaleFactor property to Typography

Scope

  • Add property to Typography
  • Add new mutator to Typography
  • Adjust behavior of Typography.generateLayout
  • Add unit tests

Discussion

I decided that the maximum scale factor should be the minimum of the limit set by the individual UI element (if any) and the Typography (if any). e.g. if label.maximumScaleFactor = 3 and typography.maximumScaleFactor = 2, then 2 will be used.

Out of Scope

I decided not to alter the value of isFixed when adjusting maximumScaleFactor because that would just complicate the behavior of what is otherwise a pretty simple struct.

馃搱 Coverage

Code

99.2%
image

Documentation

100%
image

@mpospese mpospese added the enhancement New feature or request label Mar 29, 2023
@mpospese mpospese self-assigned this Mar 29, 2023
@mpospese mpospese linked an issue Mar 29, 2023 that may be closed by this pull request
@mpospese mpospese force-pushed the issue/76-add-maximumscalefactor-to-typography branch from a917f9e to 80fcc68 Compare March 29, 2023 05:32
@mpospese mpospese merged commit 8704a54 into main Mar 30, 2023
1 check passed
@mpospese mpospese deleted the issue/76-add-maximumscalefactor-to-typography branch March 30, 2023 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Add maximumScaleFactor to Typography
3 participants