Skip to content

Commit

Permalink
fix: Reset matrix before draw
Browse files Browse the repository at this point in the history
  • Loading branch information
TiborUdvari committed Oct 18, 2024
1 parent acc916c commit 710dfd3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions examples/ar/hello-cube/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ function setup() {
}

function draw() {
push();
translate(0, 0, -0.4);
box(0.1, 0.1, 0.1);
pop();
}
2 changes: 1 addition & 1 deletion src/p5xr/core/p5xr.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export default class p5xr {
if (typeof userSetup === 'undefined') {
context.scale(context._pixelDensity, context._pixelDensity);
}

context.resetMatrix();
this.__updateXR();

p5.instance._inUserDraw = true;
Expand Down

0 comments on commit 710dfd3

Please sign in to comment.