Skip to content

Commit e228be6

Browse files
committed
Update redacted loading style and fix doc comments.
1 parent 1cd05f8 commit e228be6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Sources/LaTeXSwiftUI/LaTeX.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,17 @@ public struct LaTeX: View {
9292
/// The view remains empty until its finished rendering.
9393
case empty
9494

95-
/// The view displays the input text until its finished rendering.
95+
/// The view displays the input text until it's finished rendering.
9696
case original
9797

98+
/// The view displays a redacted version of the view until it's finished
99+
/// rendering.
98100
case redactedOriginal
99101

100-
/// The view displays a progress view until its finished rendering.
102+
/// The view displays a progress view until it's finished rendering.
101103
case progress
102104

103-
/// The view blocks on the main thread until its finished rendering.
105+
/// The view blocks on the main thread until it's finished rendering.
104106
case wait
105107
}
106108

@@ -312,11 +314,7 @@ extension LaTeX {
312314
case .original:
313315
Text(latex)
314316
case .redactedOriginal:
315-
Text(latex)
316-
.foregroundStyle(Color.clear)
317-
.background {
318-
Text(latex).redacted(reason: .placeholder)
319-
}
317+
Text(latex).redacted(reason: .placeholder)
320318
case .progress:
321319
ProgressView()
322320
default:

Sources/LaTeXSwiftUI/Previews/LaTeX_Previews+Styles.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ struct LaTeX_Previews_Styles: PreviewProvider {
4141
.renderingStyle(.original)
4242
.renderingAnimation(.default)
4343

44+
LaTeX("Hello, $\\LaTeX$!")
45+
.renderingStyle(.redactedOriginal)
46+
.renderingAnimation(.default)
47+
4448
LaTeX("Hello, $\\LaTeX$!")
4549
.renderingStyle(.progress)
4650
.renderingAnimation(.easeIn)

0 commit comments

Comments
 (0)