1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #19461 from Snuffleupagus/autolinking-lazy-borderStyle

Create the `borderStyle` of inferred links lazily (PR 19110 follow-up)
This commit is contained in:
Jonas Jenwald 2025-02-10 16:32:12 +01:00 committed by GitHub
commit 29fbed384a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 21 deletions

View file

@ -13,12 +13,7 @@
* limitations under the License.
*/
import {
AnnotationBorderStyleType,
AnnotationType,
createValidAbsoluteUrl,
Util,
} from "pdfjs-lib";
import { AnnotationType, createValidAbsoluteUrl, Util } from "pdfjs-lib";
import { getOriginalIndex, normalize } from "./pdf_find_controller.js";
function DOMRectToPDF({ width, height, left, top }, pdfPageView) {
@ -89,15 +84,9 @@ function createLinkAnnotation({ url, index, length }, pdfPageView, id) {
annotationType: AnnotationType.LINK,
rotation: 0,
...calculateLinkPosition(range, pdfPageView),
// This is just the default for AnnotationBorderStyle.
borderStyle: {
width: 1,
rawWidth: 1,
style: AnnotationBorderStyleType.SOLID,
dashArray: [3],
horizontalCornerRadius: 0,
verticalCornerRadius: 0,
},
// Populated in the annotationLayer to avoid unnecessary object creation,
// since most inferred links overlap existing LinkAnnotations:
borderStyle: null,
};
}

View file

@ -15,7 +15,6 @@
const {
AbortException,
AnnotationBorderStyleType,
AnnotationEditorLayer,
AnnotationEditorParamsType,
AnnotationEditorType,
@ -65,7 +64,6 @@ const {
export {
AbortException,
AnnotationBorderStyleType,
AnnotationEditorLayer,
AnnotationEditorParamsType,
AnnotationEditorType,