Support fractional fixed-width fonts
This commit is contained in:
parent
8bf4a0e604
commit
a4ef760c7a
1 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue