Browse Source

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.
Fabian Lange 11 years ago
parent
commit
6a0aa2cf49
  1. 1
      web/text_layer_builder.js
  2. 9
      web/viewer.css

1
web/text_layer_builder.js

@ -91,7 +91,6 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() { @@ -91,7 +91,6 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() {
transform = 'rotate(' + rotation + 'deg) ' + transform;
}
CustomStyle.setProp('transform' , textDiv, transform);
CustomStyle.setProp('transformOrigin' , textDiv, '0% 0%');
}
}

9
web/viewer.css

@ -1027,7 +1027,7 @@ html[dir='rtl'] .verticalToolbarSeparator { @@ -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 { @@ -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 { @@ -1489,7 +1494,7 @@ canvas {
}
.dialog .separator {
display: block;
display: block;
margin: 4px 0 4px 0;
height: 1px;
width: 100%;

Loading…
Cancel
Save