|
@@ -456,19 +456,21 @@ export class Session extends AREventTarget<SessionEventType>
|
456
|
456
|
const canvas = this._viewport._background;
|
457
|
457
|
const ctx = canvas.getContext('2d', { alpha: false });
|
458
|
458
|
|
459
|
|
- if(ctx) {
|
|
459
|
+ if(ctx && this.media.type != 'data') {
|
460
|
460
|
ctx.imageSmoothingEnabled = false;
|
461
|
461
|
|
462
|
462
|
// draw user media
|
463
|
|
- const image = this.media.source;
|
|
463
|
+ const image = this.media.source as CanvasImageSource;
|
464
|
464
|
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
|
465
|
465
|
|
466
|
466
|
// render output image(s)
|
467
|
467
|
for(let i = 0; i < this._trackers.length; i++) {
|
468
|
|
- const image = this._trackers[i]._output.image;
|
469
|
|
- if(image !== undefined)
|
470
|
|
- ctx.drawImage(image.source, 0, 0, canvas.width, canvas.height);
|
471
|
|
- //ctx.drawImage(image.source, canvas.width - image.width, canvas.height - image.height, image.width, image.height);
|
|
468
|
+ const media = this._trackers[i]._output.image;
|
|
469
|
+ if(media !== undefined) {
|
|
470
|
+ const image = media.source as CanvasImageSource;
|
|
471
|
+ ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
472
|
+ //ctx.drawImage(image, canvas.width - media.width, canvas.height - media.height, media.width, media.height);
|
|
473
|
+ }
|
472
|
474
|
}
|
473
|
475
|
|
474
|
476
|
// render gizmos
|