aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/webapp/assets/js/pdf.js/web
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-10-14 13:03:51 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-10-14 13:03:51 +0200
commit389abe953bf582e522acdf2c0e7b17b8fab3e18d (patch)
tree6b8f123d4da72d8d0906922a3b38928de802f8bc /pdf-as-web/src/main/webapp/assets/js/pdf.js/web
parent7aadb86776f828f13ac16c18c2e16b17e62f5d9e (diff)
downloadpdf-as-4-389abe953bf582e522acdf2c0e7b17b8fab3e18d.tar.gz
pdf-as-4-389abe953bf582e522acdf2c0e7b17b8fab3e18d.tar.bz2
pdf-as-4-389abe953bf582e522acdf2c0e7b17b8fab3e18d.zip
JS changes to work with mobile ApplicationSnapshot
Diffstat (limited to 'pdf-as-web/src/main/webapp/assets/js/pdf.js/web')
-rw-r--r--pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js b/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js
index 1af630d6..d21f5d51 100644
--- a/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js
+++ b/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js
@@ -458,8 +458,6 @@ function makeSignatureDraggable(signature) {
//
function updateSignaturePosition(signature) {
var page = signature.page;
- var canvas_height = $("#page" + page.toString()).attr("height");
- var current_scale = PDFViewerApplication.pdfViewer.currentScale;
var thisPos = $(signature.sig).position();
var x;
var y;
@@ -467,9 +465,10 @@ function updateSignaturePosition(signature) {
x = thisPos.left;
y = thisPos.top;
+ var pdfPos = PDFViewerApplication.pdfViewer.pages[page-1].viewport.convertToPdfPoint(x, y);
- signature.posx = Math.floor(x / current_scale / (4.0/3.0)).toString();
- signature.posy = Math.floor((parseInt(canvas_height) - (y)) / current_scale / (4.0/3.0)).toString();
+ signature.posx = pdfPos[0];
+ signature.posy = pdfPos[1];
last_left = $("#img_signature").css("left");