[Issue 76] Add maximumScaleFactor to Typography #81
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.
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 toTypography
Scope
Typography
Typography
Typography.generateLayout
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 adjustingmaximumScaleFactor
because that would just complicate the behavior of what is otherwise a pretty simple struct.馃搱 Coverage
Code
99.2%
Documentation
100%