Skip to content

Commit

Permalink
fix: force use 2d software canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
sorae42 committed Nov 24, 2023
1 parent ba9f448 commit 24833fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/textgen/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class BoxText {
}
draw(t) {
console.log("[BoxText.call::draw()]");
const e = t.getContext("2d");
if (!e) return void console.error("[BoxText.call::draw()] Failed to load canvas");
const e = t.getContext("2d", { willReadFrequently: true });
if (!e)
return void console.error("[BoxText.call::draw()] Failed to load canvas");
e.clearRect(0, 0, t.width, t.height);
const o = this.pendding,
i = this.gutter;
Expand Down

0 comments on commit 24833fd

Please sign in to comment.