Skip to content

Commit

Permalink
Merge pull request #319 from xpereta/fix-bottom-edge-inset
Browse files Browse the repository at this point in the history
Fix to consider the top and bottom edge insets when updating the skeleton layer height
  • Loading branch information
Juanpe authored Sep 7, 2020
2 parents cdd30bd + d4aa174 commit 997c62b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion Sources/Extensions/CALayer+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 997c62b

Please sign in to comment.