ie11 fix getBoundingClientRect() error
This commit is contained in:
parent
f3d4147f6b
commit
d40bec839d
1 changed files with 6 additions and 1 deletions
|
|
@ -128,7 +128,12 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
|
||||||
|
|
||||||
this.$measureSizes = function() {
|
this.$measureSizes = function() {
|
||||||
if (CHAR_COUNT === 1) {
|
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 = {
|
var size = {
|
||||||
height: rect.height,
|
height: rect.height,
|
||||||
width: rect.width
|
width: rect.width
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue