From d40bec839dc58e2e7c6f5484a350666b8a29731b Mon Sep 17 00:00:00 2001 From: Diego Ferreyra Date: Thu, 24 Jul 2014 17:14:40 -0300 Subject: [PATCH] ie11 fix getBoundingClientRect() error --- lib/ace/layer/font_metrics.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ace/layer/font_metrics.js b/lib/ace/layer/font_metrics.js index a1423732..a89ed9db 100644 --- a/lib/ace/layer/font_metrics.js +++ b/lib/ace/layer/font_metrics.js @@ -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