[Pkg-javascript-commits] [pdf.js] 03/204: Set transformOrigin for text layer in css.

David Prévot taffit at moszumanska.debian.org
Sat Oct 25 18:50:24 UTC 2014


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

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

commit 6a0aa2cf499bbd2a8a6d957732f2be47bfdcb750
Author: Fabian Lange <lange.fabian at gmail.com>
Date:   Mon Aug 18 21:56:15 2014 +0200

    Set transformOrigin for text layer in css.
    
    transformOrigin is set to 0% 0% in all cases. This adds extra memory
    impact into the dom tree. It also involves the CustomStyles workaround
    to determine the correct css rule for the browser.
    By setting all vendor and standard variants in css, the rule is applied
    without the dom memory overhead and without the minor computation
    overhead to set the value.
---
 web/text_layer_builder.js | 1 -
 web/viewer.css            | 9 +++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/web/text_layer_builder.js b/web/text_layer_builder.js
index 04f166e..666ebc9 100644
--- a/web/text_layer_builder.js
+++ b/web/text_layer_builder.js
@@ -91,7 +91,6 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() {
             transform = 'rotate(' + rotation + 'deg) ' + transform;
           }
           CustomStyle.setProp('transform' , textDiv, transform);
-          CustomStyle.setProp('transformOrigin' , textDiv, '0% 0%');
         }
       }
 
diff --git a/web/viewer.css b/web/viewer.css
index c7dce03..6b2f58b 100644
--- a/web/viewer.css
+++ b/web/viewer.css
@@ -1027,7 +1027,7 @@ html[dir='rtl'] .verticalToolbarSeparator {
 }
 
 .horizontalToolbarSeparator {
-  display: block; 
+  display: block;
   margin: 0 0 4px 0;
   height: 1px;
   width: 100%;
@@ -1315,6 +1315,11 @@ canvas {
   position: absolute;
   white-space: pre;
   cursor: text;
+  -webkit-transform-origin: 0% 0%;
+  -moz-transform-origin: 0% 0%;
+  -o-transform-origin: 0% 0%;
+  -ms-transform-origin: 0% 0%;
+  transform-origin: 0% 0%;
 }
 
 .textLayer .highlight {
@@ -1489,7 +1494,7 @@ canvas {
 }
 
 .dialog .separator {
-  display: block; 
+  display: block;
   margin: 4px 0 4px 0;
   height: 1px;
   width: 100%;

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