diff --git a/CHANGELOG.md b/CHANGELOG.md index 26989834..b6b45f8e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file * [**292**](https://github.com/Juanpe/SkeletonView/pull/292): Fix IBInspectable support when using Carthage - [@marisalaneous](https://github.com/marisalaneous) * [**308**](https://github.com/Juanpe/SkeletonView/pull/308): Fix example backgroundColor in DarkMode - [@toshi0383](https://github.com/toshi0383) * [**307**](https://github.com/Juanpe/SkeletonView/pull/307): Prevent incorrect skeletonLayer to be added when updating skeleton - [@wsalim1610](https://github.com/wsalim1610) +* [**319**](https://github.com/Juanpe/SkeletonView/pull/319): Fix to consider the top and bottom edge insets when updating the skeleton layer height - [@xpereta](https://github.com/xpereta) ## 📦 [1.8.7](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.7) diff --git a/Sources/Extensions/CALayer+Extensions.swift b/Sources/Extensions/CALayer+Extensions.swift index f842bf87..b768d252 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 {