Skip to content

Commit 4b987b7

Browse files
committed
Do we need to save/restore the text drawing context?
1 parent 6d7cac9 commit 4b987b7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/webgl/p5.RendererGL.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,16 @@ class RendererGL extends Renderer {
977977
}
978978
}
979979

980+
push() {
981+
this.textDrawingContext().save()
982+
super.push()
983+
}
984+
985+
pop() {
986+
super.pop()
987+
this.textDrawingContext.restore()
988+
}
989+
980990
_update() {
981991
// reset model view and apply initial camera transform
982992
// (containing only look at info; no projection).

test/unit/visual/cases/typography.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ visualSuite("Typography", function () {
279279

280280
p5.createCanvas(150, 100, mode === 'webgl' ? p5.WEBGL : undefined);
281281
if (mode === 'webgl') p5.translate(-p5.width/2, -p5.height/2);
282-
p5.textSize(19);
282+
p5.textSize(20);
283283
p5.textWrap(p5.CHAR);
284284
const font = await p5.loadFont(
285285
'/unit/assets/Inconsolata-Bold.ttf'

0 commit comments

Comments
 (0)