Support fractional fixed-width fonts

This commit is contained in:
Garen Torikian 2013-08-23 12:59:04 -07:00
commit a4ef760c7a

View file

@ -161,7 +161,11 @@ var Text = function(parentEl) {
style.overflow = "visible";
style.whiteSpace = "nowrap";
measureNode.innerHTML = "X";
var measuredString = "";
for (var i = 0; i < 100; i++)
measuredString += "X";
measureNode.innerHTML = measuredString;
var container = this.element.parentNode;
while (container && !dom.hasCssClass(container, "ace_editor"))
@ -177,7 +181,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