Add some spacing between lines in the editor

This commit is contained in:
Matt Baer 2020-10-21 15:55:05 -04:00
parent d780be07c2
commit 60ebdd2e3e

View File

@ -1,6 +1,7 @@
import SwiftUI
struct PostEditorView: View {
private let bodyLineSpacing: CGFloat = 17 * 0.5
@EnvironmentObject var model: WriteFreelyModel
@Environment(\.managedObjectContext) var moc
@Environment(\.horizontalSizeClass) var horizontalSizeClass
@ -76,6 +77,7 @@ struct PostEditorView: View {
}
TextEditor(text: $post.body)
.font(.custom("OpenSans-Regular", size: 17, relativeTo: Font.TextStyle.body))
.lineSpacing(bodyLineSpacing)
.onChange(of: post.body) { _ in
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {
post.status = PostStatus.edited.rawValue
@ -107,6 +109,7 @@ struct PostEditorView: View {
}
TextEditor(text: $post.body)
.font(.custom("Hack", size: 17, relativeTo: Font.TextStyle.body))
.lineSpacing(bodyLineSpacing)
.onChange(of: post.body) { _ in
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {
post.status = PostStatus.edited.rawValue
@ -138,6 +141,7 @@ struct PostEditorView: View {
}
TextEditor(text: $post.body)
.font(.custom("Lora", size: 17, relativeTo: Font.TextStyle.body))
.lineSpacing(bodyLineSpacing)
.onChange(of: post.body) { _ in
if post.status == PostStatus.published.rawValue && !updatingBodyFromServer {
post.status = PostStatus.edited.rawValue