ie11 fix getBoundingClientRect() error

This commit is contained in:
Diego Ferreyra 2014-07-24 17:14:40 -03:00
commit d40bec839d

View file

@ -128,7 +128,12 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
this.$measureSizes = function() {
if (CHAR_COUNT === 1) {
var rect = this.$measureNode.getBoundingClientRect();
var rect = null;
try {
rect = this.$measureNode.getBoundingClientRect();
} catch(e) {
rect = { top : this.$measureNode.offsetTop, left : this.$measureNode.offsetLeft }
};
var size = {
height: rect.height,
width: rect.width