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.overflow = "visible";
|
||||||
style.whiteSpace = "nowrap";
|
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;
|
var container = this.element.parentNode;
|
||||||
while (container && !dom.hasCssClass(container, "ace_editor"))
|
while (container && !dom.hasCssClass(container, "ace_editor"))
|
||||||
|
|
@ -177,7 +181,7 @@ var Text = function(parentEl) {
|
||||||
|
|
||||||
var size = {
|
var size = {
|
||||||
height: rect.height,
|
height: rect.height,
|
||||||
width: rect.width
|
width: rect.width / 100
|
||||||
};
|
};
|
||||||
|
|
||||||
// Size and width can be null if the editor is not visible or
|
// Size and width can be null if the editor is not visible or
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue