Skip to content

Commit 6007ef9

Browse files
author
Dmitriy Kubyshkin
committed
Fixed copy-paste error in FontMetrics.
1 parent 528d4cc commit 6007ef9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/FontMetrics.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var FontMetrics = function(family, size) {
2020

2121
// Now we can measure width and height of the letter
2222
line.innerHTML = 'm'; // It doesn't matter what text goes here
23-
this._width = line.offsetHeight;
23+
this._width = line.offsetWidth;
2424
this._height = line.offsetHeight;
2525

2626
// Now creating 1px sized item that will be aligned to baseline
@@ -35,7 +35,7 @@ var FontMetrics = function(family, size) {
3535
// Baseline is important for positioning text on canvas
3636
this._baseline = span.offsetTop + span.offsetHeight;
3737

38-
document.body.removeChild(line);
38+
// document.body.removeChild(line);
3939
};
4040

4141
module.exports = FontMetrics;

0 commit comments

Comments
 (0)