Screenshot component returns a single line of transparent pixels on the top of each screenshot
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
- A-Frame Version: 1.4.1
- Platform / Device: Firefox 111.0
- Reproducible Code Snippet or URL:
The screenshot component returns a single line of transparent pixels on the top of each screenshot when called with:
this.el.sceneEl.components.screenshot.capture('perspective');
I think flipPixelsVertically in src/components/scene/screenshot,js is out-by-one in the y dimension. Taking 1 off the height fixed it for me, eg:
flippedPixels[x * 4 + y * width * 4] = pixels[x * 4 + ((height-1) - y) * width * 4];
flippedPixels[x * 4 + 1 + y * width * 4] = pixels[x * 4 + 1 + ((height-1) - y) * width * 4];
flippedPixels[x * 4 + 2 + y * width * 4] = pixels[x * 4 + 2 + ((height-1) - y) * width * 4];
flippedPixels[x * 4 + 3 + y * width * 4] = pixels[x * 4 + 3 + ((height-1) - y) * width * 4];
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review flipPixelsVertically in src/components/scene/screenshot,js, starting with the provided perspective capture call and the reported y-dimension handling. Reproduce the issue in Firefox 111.0 and verify that screenshots no longer contain a transparent top row while retaining the correct vertical orientation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100