mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Merge pull request #26 from fsih/fixPaintTspans
Test for getAttribute before calling
This commit is contained in:
commit
bd2252651b
1 changed files with 4 additions and 0 deletions
|
@ -318,6 +318,10 @@ new function() {
|
|||
var spacing = 1.2;
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
var child = node.childNodes[i];
|
||||
// node.childNodes includes plaintext as well as elements.
|
||||
// By checking for getAttribute, we ignore plaintext
|
||||
// (node.children gets only elements but is not supported on Safari)
|
||||
if (!child.getAttribute) continue;
|
||||
lines.push(child.textContent);
|
||||
var dyString = child.getAttribute('dy');
|
||||
if (dyString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue