Skip to content

Commit

Permalink
Change AnnotationEditorLayerBuilder.render to not access "private" …
Browse files Browse the repository at this point in the history
…API functionality

The `PDFPageProxy._pageIndex` property is a "private" one that shouldn't be accessed, since it could theoretically break tomorrow if we re-factor the relevant API code.

Also, try to clean-up and improve consistency in a couple of JSDoc comments.
  • Loading branch information
Snuffleupagus committed Dec 7, 2022
1 parent d9ca37a commit 9289cb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions web/annotation_editor_layer_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/editor/tools.js").AnnotationEditorUIManager} AnnotationEditorUIManager */
// eslint-disable-next-line max-len
Expand All @@ -30,13 +29,13 @@ import { NullL10n } from "./l10n_utils.js";

/**
* @typedef {Object} AnnotationEditorLayerBuilderOptions
* @property {number} mode - Editor mode
* @property {AnnotationEditorUIManager} [uiManager]
* @property {HTMLDivElement} pageDiv
* @property {PDFPageProxy} pdfPage
* @property {TextAccessibilityManager} accessibilityManager
* @property {AnnotationStorage} annotationStorage
* @property {IL10n} l10n - Localization service.
* @property {AnnotationEditorUIManager} uiManager
* @property {IL10n} l10n
* @property {AnnotationStorage} [annotationStorage] - Storage for annotation
* data in forms.
* @property {TextAccessibilityManager} [accessibilityManager]
*/

class AnnotationEditorLayerBuilder {
Expand Down Expand Up @@ -88,7 +87,7 @@ class AnnotationEditorLayerBuilder {
div: this.div,
annotationStorage: this.annotationStorage,
accessibilityManager: this.accessibilityManager,
pageIndex: this.pdfPage._pageIndex,
pageIndex: this.pdfPage.pageNumber - 1,
l10n: this.l10n,
viewport: clonedViewport,
});
Expand Down
2 changes: 1 addition & 1 deletion web/default_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class DefaultAnnotationEditorLayerFactory {
* @property {PDFPageProxy} pdfPage
* @property {IL10n} l10n
* @property {AnnotationStorage} [annotationStorage] - Storage for annotation
* @property {TextAccessibilityManager} [accessibilityManager]
* data in forms.
* @property {TextAccessibilityManager} [accessibilityManager]
*/

/**
Expand Down

0 comments on commit 9289cb7

Please sign in to comment.