File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ struct ContextDisplayView: View {
7474 baseFontSize + furiganaFontSize + furiganaSpacing
7575 }
7676
77+ private var shouldUsePlainTextLayout : Bool {
78+ guard let segment = furiganaSegments. first else { return true }
79+
80+ return furiganaSegments. count == 1
81+ && segment. reading == nil
82+ && segment. base == context
83+ && segment. baseRange. lowerBound == context. startIndex
84+ && segment. baseRange. upperBound == context. endIndex
85+ }
86+
7787 private var themedBackgroundColor : Color {
7888 presentationTheme? . backgroundColor ?? Color ( . systemBackground)
7989 }
@@ -178,10 +188,10 @@ struct ContextDisplayView: View {
178188
179189 @ViewBuilder
180190 private func contextTextContent( width: CGFloat ) -> some View {
181- if !furiganaSegments. isEmpty {
182- segmentedTextView ( width: width)
183- } else {
191+ if shouldUsePlainTextLayout {
184192 plainTextView ( width: width)
193+ } else {
194+ segmentedTextView ( width: width)
185195 }
186196 }
187197
You can’t perform that action at this time.
0 commit comments