The goal of this PR is to improve how the height of the lines for text nodes is calculated. Until now, the library decided to use the font height, the constraints, or the default value. Now, exist a new type to define how the library should calculate the height.
Before
You could only decide whether to use the height of the source line or not:
label.useFontLineHeight = true
After
Now, you can be more specific:
label.skeletonTextLineHeight = .relativeToFont
Here the SkeletonTextLineHeight definition:
enum SkeletonTextLineHeight: Equatable {
/// Calculates the line height based on the font line-height.
case relativeToFont
/// Calculates the line height based on the height constraints.
///
/// If no constraints exist, the height will be set to the `multilineHeight`
/// value defined in the `SkeletonAppearance`.
case relativeToConstraints
/// Returns the specific height specified as the associated value.
case fixed(CGFloat)
}
Summary
The goal of this PR is to improve how the height of the lines for text nodes is calculated. Until now, the library decided to use the font height, the constraints, or the default value. Now, exist a new type to define how the library should calculate the height.
Before
You could only decide whether to use the height of the source line or not:
After
Now, you can be more specific:
Here the
SkeletonTextLineHeight
definition: