Skip to content

Commit

Permalink
3.17.11
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Dec 7, 2023
1 parent 1d77368 commit 9cf8ac8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions p5play.js
Original file line number Diff line number Diff line change
Expand Up @@ -8461,9 +8461,9 @@ main {
return;
}
let tg = $.createGraphics.call($, 1, 1);
tg.textFont(r._textFont);
if (r._textStyle) tg.textStyle(r._textStyle);
tg.textSize(r._textSize);
tg.textFont($.textFont());
if ($.textStyle()) tg.textStyle($.textStyle());
tg.textSize($.textSize());
c = tg.canvas.getContext('2d');
let lines = str.split('\n');
cX = 0;
Expand All @@ -8473,17 +8473,16 @@ main {
_descent = m.fontBoundingBoxDescent;
h ??= cY + _descent;
tg.resizeCanvas(Math.ceil(tg.textWidth(str)), Math.ceil(h));
c.fillStyle = ctx.fillStyle;
c.strokeStyle = ctx.strokeStyle;
c.lineWidth = ctx.lineWidth;
let f = c.fillStyle;
if (!r._fillSet) c.fillStyle = 'black';
tg.fill(ctx.fillStyle);
if (r._doStroke) {
tg.stroke(ctx.strokeStyle);
tg.strokeWeight(ctx.lineWidth);
} else tg.noStroke();
for (let i = 0; i < lines.length; i++) {
tg.text(lines[i], cX, cY);
cY += r._textLeading;
if (cY > h) break;
}
if (!r._fillSet) c.fillStyle = f;
ti = tg.get();
let pd = $.pixelDensity();
ti.width /= pd;
Expand Down
2 changes: 1 addition & 1 deletion p5play.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
"version": "git add -A",
"postversion": "git push"
},
"version": "3.17.10"
"version": "3.17.11"
}

0 comments on commit 9cf8ac8

Please sign in to comment.