From fea9160a1587748dc947ddf3eb6c249c19ff02db Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Fri, 23 Oct 2020 14:06:37 -0400 Subject: [PATCH] =?UTF-8?q?Use=20adaptive=20line=20spacing=20on=20iOS?= =?UTF-8?q?=C2=A0(fixes=20#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/PostEditor/PostTextEditingView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iOS/PostEditor/PostTextEditingView.swift b/iOS/PostEditor/PostTextEditingView.swift index d6770fb..94a519a 100644 --- a/iOS/PostEditor/PostTextEditingView.swift +++ b/iOS/PostEditor/PostTextEditingView.swift @@ -7,6 +7,7 @@ enum PostAppearance: String { } struct PostTextEditingView: View { + @Environment(\.horizontalSizeClass) var horizontalSizeClass @ObservedObject var post: WFAPost @Binding var updatingTitleFromServer: Bool @Binding var updatingBodyFromServer: Bool @@ -44,7 +45,7 @@ struct PostTextEditingView: View { } TextEditor(text: $post.body) .font(.custom(appearance.rawValue, size: 17, relativeTo: .body)) - .lineSpacing(17 * bodyLineSpacingMultiplier) + .lineSpacing(17 * (horizontalSizeClass == .compact ? 0.25 : bodyLineSpacingMultiplier)) .onChange(of: post.body) { _ in if post.status == PostStatus.published.rawValue && !updatingBodyFromServer { post.status = PostStatus.edited.rawValue