From 7a7b40ff9934222e8dc2aa9e914181cff1ece7cd Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Wed, 29 Jul 2026 14:41:50 +0200 Subject: [PATCH] iOS: Text-Scan zerlegt Bloecke in einzelne Zeilen Ein erkannter Textblock konnte mehrere Zeilen enthalten; die Auswahl uebernahm dann mehrzeiligen Text. Jetzt wird strikt in einzelne Zeilen zerlegt, sodass jede Auswahl genau eine Zeile ist. Co-Authored-By: Claude Opus 4.8 --- ios/Sources/DateScanView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios/Sources/DateScanView.swift b/ios/Sources/DateScanView.swift index e90a2d4..5bb420a 100644 --- a/ios/Sources/DateScanView.swift +++ b/ios/Sources/DateScanView.swift @@ -99,7 +99,10 @@ struct TextScanView: View { ZStack(alignment: .bottom) { if Self.isSupported { TextLinesScannerRepresentable { erkannt in - for t in erkannt.reversed() { + // Ein erkannter Textblock kann mehrere Zeilen umfassen – strikt + // in einzelne Zeilen zerlegen, damit jede Auswahl genau eine ist. + let einzeln = erkannt.flatMap { $0.components(separatedBy: .newlines) } + for t in einzeln.reversed() { let sauber = t.trimmingCharacters(in: .whitespacesAndNewlines) guard sauber.count >= 2, !zeilen.contains(sauber) else { continue } zeilen.insert(sauber, at: 0)