Remove unused ol.dom.transformElement2D()

This commit is contained in:
Tim Schaub
2016-08-31 15:24:53 -06:00
parent c469241bee
commit c11c4e4d17
2 changed files with 0 additions and 163 deletions

View File

@@ -123,54 +123,6 @@ ol.dom.setTransform = function(element, value) {
};
/**
* @param {!Element} element Element.
* @param {ol.Transform} transform Matrix.
* @param {number=} opt_precision Precision.
*/
ol.dom.transformElement2D = function(element, transform, opt_precision) {
// using matrix() causes gaps in Chrome and Firefox on Mac OS X, so prefer
// matrix3d()
var i;
if (ol.dom.canUseCssTransform3D()) {
var value3D;
var transform3D = ol.vec.Mat4.fromTransform(ol.dom.tmpMat4_, transform);
if (opt_precision !== undefined) {
/** @type {Array.<string>} */
var strings3D = new Array(16);
for (i = 0; i < 16; ++i) {
strings3D[i] = transform3D[i].toFixed(opt_precision);
}
value3D = strings3D.join(',');
} else {
value3D = transform3D.join(',');
}
ol.dom.setTransform(element, 'matrix3d(' + value3D + ')');
} else if (ol.dom.canUseCssTransform()) {
/** @type {string} */
var value2D;
if (opt_precision !== undefined) {
/** @type {Array.<string>} */
var strings2D = new Array(6);
for (i = 0; i < 6; ++i) {
strings2D[i] = transform[i].toFixed(opt_precision);
}
value2D = strings2D.join(',');
} else {
value2D = transform.join(',');
}
ol.dom.setTransform(element, 'matrix(' + value2D + ')');
} else {
element.style.left = Math.round(transform[4]) + 'px';
element.style.top = Math.round(transform[5]) + 'px';
// TODO: Add scaling here. This isn't quite as simple as multiplying
// width/height, because that only changes the container size, not the
// content size.
}
};
/**
* Get the current computed width for the given element including margin,
* padding and border.