[Pkg-javascript-commits] [pdf.js] 98/157: More cleanup regarding annotation border styles

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 06:46:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 465611a2ff3cd453f5ac3c22cdbd6a8e9bb13b96
Author: Tim van der Meij <timvandermeij at gmail.com>
Date:   Fri Jul 17 21:51:24 2015 +0200

    More cleanup regarding annotation border styles
---
 src/core/annotation.js             | 1 -
 src/display/annotation_helper.js   | 6 +++---
 test/unit/annotation_layer_spec.js | 6 ++----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/core/annotation.js b/src/core/annotation.js
index 22ee0bf..3fb6f95 100644
--- a/src/core/annotation.js
+++ b/src/core/annotation.js
@@ -160,7 +160,6 @@ var Annotation = (function AnnotationClosure() {
           this.borderStyle.setHorizontalCornerRadius(array[0]);
           this.borderStyle.setVerticalCornerRadius(array[1]);
           this.borderStyle.setWidth(array[2]);
-          this.borderStyle.setStyle('S');
 
           if (array.length === 4) { // Dash array available
             this.borderStyle.setDashArray(array[3]);
diff --git a/src/display/annotation_helper.js b/src/display/annotation_helper.js
index af30c28..9225359 100644
--- a/src/display/annotation_helper.js
+++ b/src/display/annotation_helper.js
@@ -45,7 +45,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
     style.fontFamily = fontFamily + fallbackName;
   }
 
-  function initContainer(item, drawBorder) {
+  function initContainer(item) {
     var container = document.createElement('section');
     var cstyle = container.style;
     var width = item.rect[2] - item.rect[0];
@@ -149,7 +149,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
       rect[2] = rect[0] + (rect[3] - rect[1]); // make it square
     }
 
-    var container = initContainer(item, false);
+    var container = initContainer(item);
     container.className = 'annotText';
 
     var image  = document.createElement('img');
@@ -256,7 +256,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() {
   }
 
   function getHtmlElementForLinkAnnotation(item) {
-    var container = initContainer(item, true);
+    var container = initContainer(item);
     container.className = 'annotLink';
 
     var link = document.createElement('a');
diff --git a/test/unit/annotation_layer_spec.js b/test/unit/annotation_layer_spec.js
index 889004f..1c45b63 100644
--- a/test/unit/annotation_layer_spec.js
+++ b/test/unit/annotation_layer_spec.js
@@ -1,6 +1,6 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-/* globals expect, it, describe, Dict, Annotation, AnnotationBorderStyle,
+/* globals expect, it, describe, Dict, Name, Annotation, AnnotationBorderStyle,
            AnnotationBorderStyleType */
 
 'use strict';
@@ -79,9 +79,7 @@ describe('Annotation layer', function() {
 
     it('should set and get a valid style', function() {
       var borderStyle = new AnnotationBorderStyle();
-      var dict = new Dict();
-      dict.name = 'D';
-      borderStyle.setStyle(dict);
+      borderStyle.setStyle(Name.get('D'));
 
       expect(borderStyle.style).toEqual(AnnotationBorderStyleType.DASHED);
     });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list