From b443dcc17c2b0875fee043197c572ed9fa496283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanpe=20Catala=CC=81n?= Date: Tue, 1 Sep 2020 20:18:24 +0200 Subject: [PATCH 1/2] use multiline height when text is a single line --- Sources/Extensions/CALayer+Extensions.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Extensions/CALayer+Extensions.swift b/Sources/Extensions/CALayer+Extensions.swift index 98d8707f..f842bf87 100644 --- a/Sources/Extensions/CALayer+Extensions.swift +++ b/Sources/Extensions/CALayer+Extensions.swift @@ -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 } @@ -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 } From 8258b73b354d6ba06d510fac63887aef0349b32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanpe=20Catala=CC=81n?= Date: Tue, 1 Sep 2020 20:24:42 +0200 Subject: [PATCH 2/2] Include the PR in the CHANGELOG file --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a078dde1..b3a4039e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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