Merge pull request #1566 from ajaxorg/webkit-fractional-fix

Webkit fractional fix
This commit is contained in:
Harutyun Amirjanyan 2013-08-23 14:11:08 -07:00
commit 330b8a4a8e

View file

@ -161,7 +161,8 @@ var Text = function(parentEl) {
style.overflow = "visible";
style.whiteSpace = "nowrap";
measureNode.innerHTML = "X";
// fixes fractional fixed-width fonts; see http://git.io/CavZNw
measureNode.innerHTML = lang.stringRepeat("X", 100);
var container = this.element.parentNode;
while (container && !dom.hasCssClass(container, "ace_editor"))
@ -177,7 +178,7 @@ var Text = function(parentEl) {
var size = {
height: rect.height,
width: rect.width
width: rect.width / 100
};
// Size and width can be null if the editor is not visible or