Fix: add radix parameter for parseInt

master
cuixiping 2020-01-07 16:39:42 +08:00
parent 471035c0da
commit 4f6def7582
1 changed files with 3 additions and 3 deletions

View File

@ -216,7 +216,7 @@ const svgElementToPdf = function (element, pdf, options) {
}
pdf.setFontType(fontType);
const pdfFontSize = node.hasAttribute('font-size')
? parseInt(node.getAttribute('font-size'))
? parseInt(node.getAttribute('font-size'), 10)
: 16;
/**
@ -252,8 +252,8 @@ const svgElementToPdf = function (element, pdf, options) {
case 'start': break;
case 'default': node.setAttribute('text-anchor', 'start'); break;
}
x = parseInt(node.getAttribute('x')) - xOffset;
y = parseInt(node.getAttribute('y'));
x = parseInt(node.getAttribute('x'), 10) - xOffset;
y = parseInt(node.getAttribute('y'), 10);
}
// console.log('fontSize:', pdfFontSize, 'text:', node.textContent);
pdf.setFontSize(pdfFontSize).text(