From 5ada5cd58a3c910f90c914d7adfc3c4bd9f8e20c Mon Sep 17 00:00:00 2001 From: "Jeremy B. Merrill" Date: Thu, 25 Feb 2016 12:06:34 -0500 Subject: [PATCH] removes all references to rotation, assuming it's been handled upstream; fixes #468 --- webapp/static/js/pdf_view.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/webapp/static/js/pdf_view.js b/webapp/static/js/pdf_view.js index 5f876243..a04b4c51 100644 --- a/webapp/static/js/pdf_view.js +++ b/webapp/static/js/pdf_view.js @@ -62,9 +62,8 @@ Tabula.Selection = Backbone.Model.extend({ var original_pdf_width = page.get('width'); var original_pdf_height = page.get('height'); - var pdf_rotation = page.get('rotation'); - var scale = (Math.abs(pdf_rotation) == 90 ? original_pdf_height : original_pdf_width) / imageWidth; + var scale = original_pdf_width / imageWidth; var rp = this.attributes.getDims().relativePos; this.set({ x1: rp.left * scale, @@ -1139,7 +1138,6 @@ Tabula.PDFView = Backbone.View.extend( var page = Tabula.pdf_view.pdf_document.page_collection.findWhere({number: sel.page}); var original_pdf_width = page.get('width'); var original_pdf_height = page.get('height'); - var pdf_rotation = page.get('rotation'); // TODO: create selection models for pages that aren't lazyloaded, but obviously don't display them. if(Tabula.LazyLoad && !pageView){ @@ -1152,7 +1150,7 @@ Tabula.PDFView = Backbone.View.extend( if (!$img.length || $img.data('loaded') !== 'loaded' || !$img.height() ){ // if this page isn't shown currently or the image hasn't been rendered yet, then create a hidden selectionx return this.pdf_document.selections.createHiddenSelection(sel); } - var scale = image_width / (Math.abs(pdf_rotation) == 90 ? original_pdf_height : original_pdf_width); + var scale = image_width / original_pdf_width; var offset = $img.offset(); var absolutePos = _.extend({}, offset, {