From 710dfd3a99de6ebf6b78508cdd835d26c8fd434a Mon Sep 17 00:00:00 2001 From: Tibor Udvari Date: Fri, 18 Oct 2024 08:58:46 +0200 Subject: [PATCH] fix: Reset matrix before draw --- examples/ar/hello-cube/example.js | 2 -- src/p5xr/core/p5xr.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/ar/hello-cube/example.js b/examples/ar/hello-cube/example.js index fa8aa4d..96850c3 100644 --- a/examples/ar/hello-cube/example.js +++ b/examples/ar/hello-cube/example.js @@ -4,8 +4,6 @@ function setup() { } function draw() { - push(); translate(0, 0, -0.4); box(0.1, 0.1, 0.1); - pop(); } diff --git a/src/p5xr/core/p5xr.js b/src/p5xr/core/p5xr.js index 28cf229..b24d729 100644 --- a/src/p5xr/core/p5xr.js +++ b/src/p5xr/core/p5xr.js @@ -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;