Start passing in position info when creating highlights on PDFs
This commit is contained in:
@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user