mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Let the two annotation factories use static methods
This corresponds to how other factories are implemented.
This commit is contained in:
parent
af10f8b586
commit
4f02857394
4 changed files with 48 additions and 53 deletions
|
@ -38,7 +38,7 @@ class AnnotationElementFactory {
|
|||
* @param {AnnotationElementParameters} parameters
|
||||
* @returns {AnnotationElement}
|
||||
*/
|
||||
create(parameters) {
|
||||
static create(parameters) {
|
||||
let subtype = parameters.data.annotationType;
|
||||
|
||||
switch (subtype) {
|
||||
|
@ -974,14 +974,12 @@ class AnnotationLayer {
|
|||
* @memberof AnnotationLayer
|
||||
*/
|
||||
static render(parameters) {
|
||||
let annotationElementFactory = new AnnotationElementFactory();
|
||||
|
||||
for (let i = 0, ii = parameters.annotations.length; i < ii; i++) {
|
||||
let data = parameters.annotations[i];
|
||||
if (!data) {
|
||||
continue;
|
||||
}
|
||||
let element = annotationElementFactory.create({
|
||||
let element = AnnotationElementFactory.create({
|
||||
data,
|
||||
layer: parameters.div,
|
||||
page: parameters.page,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue