From 770be4fc068bea3c3ec6d5dbefc0738b2b5e2d77 Mon Sep 17 00:00:00 2001 From: Xavier Pereta Date: Mon, 31 Aug 2020 17:01:51 +0200 Subject: [PATCH 1/2] 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 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 { From d4aa1743e6e3549d824b9e4280e50a8f13e59cce Mon Sep 17 00:00:00 2001 From: Xavier Pereta Date: Thu, 3 Sep 2020 23:07:48 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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)