Skip to content

Commit 39b8e38

Browse files
committed
minor fix
1 parent d9fe1a2 commit 39b8e38

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: lib/anychart-node.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@
6161
elem.getBBox = function() {
6262
var text = elem.innerHTML;
6363
var fontSize = parseFloat(elem.getAttribute('font-size'));
64-
var fontFamily = elem.getAttribute('font-family').toLowerCase();
65-
var fontWeight = elem.getAttribute('font-weight').toLowerCase();
66-
var fontStyle = elem.getAttribute('font-style').toLowerCase();
64+
var fontFamily = elem.getAttribute('font-family');
65+
if (fontFamily) fontFamily = fontFamily.toLowerCase();
66+
var fontWeight = elem.getAttribute('font-weight');
67+
if (fontWeight) fontWeight = fontWeight.toLowerCase();
68+
var fontStyle = elem.getAttribute('font-style');
69+
if (fontStyle) fontStyle = fontStyle.toLowerCase();
6770

6871
var fontsArr = fontFamily.split(', ');
6972

@@ -77,8 +80,6 @@
7780
if (!font)
7881
font = fonts['verdana'];
7982

80-
// if (!font) console.log(fontFamily, fonts);
81-
8283
var scale = 1 / font.unitsPerEm * fontSize;
8384

8485
var top = -font.ascender * scale;

0 commit comments

Comments
 (0)