mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various Improvements
This commit is contained in:
parent
5aeef57fc9
commit
e00a658fcb
@ -241,10 +241,11 @@ public final class RecognizedTextSelectionNode: ASDisplayNode {
|
|||||||
})
|
})
|
||||||
var textRecognitions: [(String, RecognizedContent.Rect)] = []
|
var textRecognitions: [(String, RecognizedContent.Rect)] = []
|
||||||
for recognition in sortedRecognitions {
|
for recognition in sortedRecognitions {
|
||||||
if case let .text(string, words) = recognition.content {
|
if case let .text(string, _) = recognition.content {
|
||||||
for word in words {
|
textRecognitions.append((string, recognition.rect))
|
||||||
textRecognitions.append((String(string[word.0]), word.1))
|
// for word in words {
|
||||||
}
|
// textRecognitions.append((String(string[word.0]), word.1))
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.recognitions = textRecognitions
|
self.recognitions = textRecognitions
|
||||||
@ -493,7 +494,7 @@ public final class RecognizedTextSelectionNode: ASDisplayNode {
|
|||||||
if selectedIndices.contains(i) {
|
if selectedIndices.contains(i) {
|
||||||
let (string, _) = self.recognitions[i]
|
let (string, _) = self.recognitions[i]
|
||||||
if !selectedText.isEmpty {
|
if !selectedText.isEmpty {
|
||||||
selectedText += " "
|
selectedText += "\n"
|
||||||
}
|
}
|
||||||
selectedText.append(contentsOf: string.trimmingCharacters(in: .whitespacesAndNewlines))
|
selectedText.append(contentsOf: string.trimmingCharacters(in: .whitespacesAndNewlines))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user