Skip to content

Commit

Permalink
Merge pull request #244 from TiborUdvari/fix/reset-matrix
Browse files Browse the repository at this point in the history
fix: Reset matrix before draw
  • Loading branch information
TiborUdvari authored Oct 18, 2024
2 parents acc916c + 710dfd3 commit d7ff13d
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 d7ff13d

Please sign in to comment.