[Pkg-javascript-commits] [pdf.js] 04/414: Fix incorrect position of text widget

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:11:59 UTC 2016


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

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

commit 8bf17f5df83c667e6986e941ec472f865b3f256f
Author: Xiliang Chen <xlchen1291 at gmail.com>
Date:   Wed Dec 16 11:21:01 2015 +1300

    Fix incorrect position of text widget
---
 src/display/annotation_layer.js | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js
index f24db67..aabdd31 100644
--- a/src/display/annotation_layer.js
+++ b/src/display/annotation_layer.js
@@ -123,13 +123,8 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
     return container;
   }
 
-  function getHtmlElementForTextWidgetAnnotation(item, page) {
-    var element = document.createElement('div');
-    var width = item.rect[2] - item.rect[0];
-    var height = item.rect[3] - item.rect[1];
-    element.style.width = width + 'px';
-    element.style.height = height + 'px';
-    element.style.display = 'table';
+  function getHtmlElementForTextWidgetAnnotation(item, page, viewport) {
+    var container = getContainer(item, page, viewport);
 
     var content = document.createElement('div');
     content.textContent = item.fieldValue;
@@ -142,9 +137,9 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
       page.commonObjs.getData(item.fontRefName) : null;
     setTextStyles(content, item, fontObj);
 
-    element.appendChild(content);
+    container.appendChild(content);
 
-    return element;
+    return container;
   }
 
   function getHtmlElementForTextAnnotation(item, page, viewport) {
@@ -313,7 +308,7 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
   function getHtmlElement(data, page, viewport, linkService) {
     switch (data.annotationType) {
       case AnnotationType.WIDGET:
-        return getHtmlElementForTextWidgetAnnotation(data, page);
+        return getHtmlElementForTextWidgetAnnotation(data, page, viewport);
       case AnnotationType.TEXT:
         return getHtmlElementForTextAnnotation(data, page, viewport);
       case AnnotationType.LINK:

-- 
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