fix: Consider the bottom and top edge insets when updating the height of the skeleton layer.

This commit is contained in:
Xavier Pereta
2020-09-03 23:00:42 +02:00
parent cdd30bd623
commit 770be4fc06
+1 -1
View File
@@ -101,7 +101,7 @@ extension CALayer {
func updateLayerFrame(for index: Int, size: CGSize, multilineSpacing: CGFloat, paddingInsets: UIEdgeInsets) {
let spaceRequiredForEachLine = SkeletonAppearance.default.multilineHeight + multilineSpacing
frame = CGRect(x: paddingInsets.left, y: CGFloat(index) * spaceRequiredForEachLine + paddingInsets.top, width: size.width, height: size.height)
frame = CGRect(x: paddingInsets.left, y: CGFloat(index) * spaceRequiredForEachLine + paddingInsets.top, width: size.width, height: size.height - paddingInsets.bottom - paddingInsets.top)
}
private func calculateNumLines(for config: SkeletonMultilinesLayerConfig) -> Int {