Skip to content

setup canvas on first capture screenshot.js#5442

Merged
dmarcos merged 9 commits into
aframevr:masterfrom
capticxyz:arpu-patch-1
Feb 2, 2024
Merged

setup canvas on first capture screenshot.js#5442
dmarcos merged 9 commits into
aframevr:masterfrom
capticxyz:arpu-patch-1

Conversation

@arpu

@arpu arpu commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

Description:
The default Screenshot Component always creates a shader and canvas on init()
this PR change it on first usage of screenshot capture.

Changes proposed:
-set canvas on first capture usage

Comment thread src/components/scene/screenshot.js Outdated
Comment thread src/components/scene/screenshot.js Outdated
Comment thread src/components/scene/screenshot.js Outdated
Comment thread src/components/scene/screenshot.js Outdated
Comment thread src/components/scene/screenshot.js Outdated
@dmarcos

dmarcos commented Feb 2, 2024

Copy link
Copy Markdown
Member

Thank you!

@dmarcos
dmarcos merged commit e489e5a into aframevr:master Feb 2, 2024
@mrxz

mrxz commented Mar 14, 2024

Copy link
Copy Markdown
Contributor

@arpu This PR causes a regression when people use the screenshot component in the following way:

document.querySelector('a-scene').components.screenshot.getCanvas('perspective');

The getCanvas is part of its public API and documented in case the user doesn't want to automatically download the file, but do something else with it. See https://aframe.io/docs/1.5.0/components/screenshot.html#methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants