Skip to content

Commit

Permalink
Merge pull request #320 from Juanpe/fix_labels_single_line_appearance
Browse files Browse the repository at this point in the history
Fix Single line customisation
  • Loading branch information
Juanpe authored Sep 1, 2020
2 parents 3d9e906 + 8258b73 commit 0c500a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file

### Next version

#### 🩹 Bug fixes
* [**320**](https://github.com/Juanpe/SkeletonView/pull/320): Fix Single line customisation - [@Juanpe](https://github.com/juanpe)

### 📦 [1.8.8](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.8)

#### 🙌 New
Expand Down
6 changes: 4 additions & 2 deletions Sources/Extensions/CALayer+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ extension CALayer {
func addMultilinesLayers(for config: SkeletonMultilinesLayerConfig) {
let numberOfSublayers = config.lines == 1 ? 1 : calculateNumLines(for: config)
var height = config.lineHeight ?? SkeletonAppearance.default.multilineHeight
if numberOfSublayers == 1 {

if numberOfSublayers == 1 && SkeletonAppearance.default.renderSingleLineAsView {
height = bounds.height
}

Expand Down Expand Up @@ -79,7 +80,8 @@ extension CALayer {
let paddingInsets = config.paddingInsets
let multilineSpacing = config.multilineSpacing
var height = config.lineHeight ?? SkeletonAppearance.default.multilineHeight
if numberOfSublayers == 1 {

if numberOfSublayers == 1 && SkeletonAppearance.default.renderSingleLineAsView {
height = bounds.height
}

Expand Down

0 comments on commit 0c500a9

Please sign in to comment.