on master help sign in
Fix bug with text resizing in FF and IE. Both report clientWidth and clientHeight as an integer that has been rounded DOWN from the actual float value. This means they can be too small. Switched to using getComputedStyle.
d9d6ce5evancz
libraries/Native/Utils.js+3−2
@@ -114,8 +114,9 @@ Elm.Native.Utils = function(elm) {
114 t.style.cssFloat = "left";
114 t.style.cssFloat = "left";
115
115
116 elm.node.appendChild(t);
116 elm.node.appendChild(t);
117− var w = t.clientWidth;
117+ var style = window.getComputedStyle(t, null);
118− var h = t.clientHeight;
118+ var w = Math.ceil(style.getPropertyValue("width").slice(0,-2) - 0);
119+ var h = Math.ceil(style.getPropertyValue("height").slice(0,-2) - 0);
119 elm.node.removeChild(t);
120 elm.node.removeChild(t);
120 return Tuple2(w,h);
121 return Tuple2(w,h);
121 }
122 }