Closed nkint closed 4 years ago
@nkint You probably meant jsdom
(as in the issue), right?
@vijithassar Please merge this PR. There's really no reason not to 😉
Some minor optimizations could be:
// no padding -> leave attributes unchanged
if (padding > 0) {
var cx = parseInt(text.attr('x'), 10) || 0;
var cy = parseInt(text.attr('y'), 10) || 0;
text
.attr('y', cy + padding)
.attr('x', cx + padding);
}
That should save unnecessary DOM manipulations and improve the performance of parseInt
.
Patch to fix this issue:
12
Due to
json
limitation I can't write a proper test.