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.
This commit is contained in:
Fabian Lange 2014-08-18 21:56:15 +02:00
parent 4ef70588de
commit 6a0aa2cf49
2 changed files with 7 additions and 3 deletions

View File

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

View File

@ -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%;