From 770be4fc068bea3c3ec6d5dbefc0738b2b5e2d77 Mon Sep 17 00:00:00 2001 From: Xavier Pereta Date: Mon, 31 Aug 2020 17:01:51 +0200 Subject: [PATCH] fix: Consider the bottom and top edge insets when updating the height of the skeleton layer. --- Sources/Extensions/CALayer+Extensions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Extensions/CALayer+Extensions.swift b/Sources/Extensions/CALayer+Extensions.swift index f842bf8..b768d25 100644 --- a/Sources/Extensions/CALayer+Extensions.swift +++ b/Sources/Extensions/CALayer+Extensions.swift @@ -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 {