(display)
| 1866 | |
| 1867 | // Compute the default character width. |
| 1868 | function charWidth(display) { |
| 1869 | if (display.cachedCharWidth != null) return display.cachedCharWidth; |
| 1870 | var anchor = elt("span", "xxxxxxxxxx"); |
| 1871 | var pre = elt("pre", [anchor]); |
| 1872 | removeChildrenAndAdd(display.measure, pre); |
| 1873 | var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; |
| 1874 | if (width > 2) display.cachedCharWidth = width; |
| 1875 | return width || 10; |
| 1876 | } |
| 1877 | |
| 1878 | // OPERATIONS |
| 1879 |
no test coverage detected
searching dependent graphs…