diff --git a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift index d64b600fc..dc1091f7b 100644 --- a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift +++ b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift @@ -296,7 +296,10 @@ import Utils shortId: shortId, highlightID: highlightID, quote: quote, - patch: patch + patch: patch, + // TODO + positionPercent: nil, + positionAnchorIndex: Int(pageView.pageIndex) ) } else { let overlappingRects = overlapping.map(\.rects).compactMap { $0 }.flatMap { $0 } @@ -317,6 +320,9 @@ import Utils highlightID: highlightID, quote: quote, patch: patch, + // TODO: + positionPercent: nil, + positionAnchorIndex: Int(pageView.pageIndex), overlapHighlightIdList: highlightIds(overlapping) ) } diff --git a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewerViewModel.swift b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewerViewModel.swift index 89b4dd7a2..4b443aaed 100644 --- a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewerViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewerViewModel.swift @@ -22,7 +22,9 @@ final class PDFViewerViewModel: ObservableObject { shortId: String, highlightID: String, quote: String, - patch: String + patch: String, + positionPercent: Double?, + positionAnchorIndex: Int? ) { _ = dataService.createHighlight( shortId: shortId, @@ -30,9 +32,8 @@ final class PDFViewerViewModel: ObservableObject { quote: quote, patch: patch, articleId: pdfItem.itemID, - // TODO: - positionPercent: nil, - positionAnchorIndex: nil + positionPercent: positionPercent, + positionAnchorIndex: positionAnchorIndex ) } @@ -43,6 +44,8 @@ final class PDFViewerViewModel: ObservableObject { highlightID: String, quote: String, patch: String, + positionPercent: Double?, + positionAnchorIndex: Int?, overlapHighlightIdList: [String] ) { _ = dataService.mergeHighlights( @@ -51,9 +54,8 @@ final class PDFViewerViewModel: ObservableObject { quote: quote, patch: patch, articleId: pdfItem.itemID, - // TODO: - positionPercent: nil, - positionAnchorIndex: nil, + positionPercent: positionPercent, + positionAnchorIndex: positionAnchorIndex, overlapHighlightIdList: overlapHighlightIdList ) }