mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Start passing in position info when creating highlights on PDFs
This commit is contained in:
parent
08405dbcc2
commit
d8aa36f148
2 changed files with 16 additions and 8 deletions
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue