diff --git a/package.json b/package.json index e04d74f8..4fc24497 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xpadev-net/niconicomments", - "version": "0.2.66", + "version": "0.2.67", "description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.", "main": "dist/bundle.js", "types": "dist/bundle.d.ts", diff --git a/src/inputParser.ts b/src/inputParser.ts index 9cffbc9e..773798df 100755 --- a/src/inputParser.ts +++ b/src/inputParser.ts @@ -79,7 +79,7 @@ const fromXMLDocument = (data: XMLDocument): FormattedComment[] => { const tmpParam: FormattedComment = { id: Number(item.getAttribute("no")) || index++, vpos: Number(item.getAttribute("vpos")), - content: item.innerHTML, + content: item.textContent ?? "", date: Number(item.getAttribute("date")) || 0, date_usec: Number(item.getAttribute("date_usec")) || 0, owner: !item.getAttribute("user_id"), diff --git a/src/main.ts b/src/main.ts index e8f7f2e0..c92ba61a 100755 --- a/src/main.ts +++ b/src/main.ts @@ -282,8 +282,7 @@ class NiconiComments { []; if (arrayEqual(current, last)) return false; } - const size = this.renderer.getSize(); - this.renderer.clearRect(0, 0, size.width, size.height); + this.renderer.clearRect(0, 0, config.canvasWidth, config.canvasHeight); this.lastVpos = vpos; this._drawVideo(); for (const plugin of plugins) {