"draw a bounding box from the framebuffer" misbehaves for Take Element Screenshot
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 718
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
In chapter 17. Screen capture:
Let paint width be the initial viewport’s width – min(rectangle x coordinate, rectangle x coordinate + rectangle width dimension).
Let paint height be the initial viewport’s height – min(rectangle y coordinate, rectangle y coordinate + rectangle height dimension).
Consider a viewport that is 1000px wide, 1000 px tall. We want to take an element screenshot for an element with the following values:
X coordinate: 100
Y coordinate: 100
Width: 400px
Height: 200px
In order to draw a bounding box from the framebuffer, given the above rectangle:
Let paint width be the initial viewport’s width – min(rectangle x coordinate, rectangle x coordinate + rectangle width dimension).
paint width = 1000 - min(100, 100 + 400) = 1000 - 100 = 900
paint height = 1000 - min(100, 100 + 200) = 1000 - 100 = 900
According to step 6 later on, these dimensions are used for the width and height of the resulting canvas. This is not correct. The width should be the width of the element, 400 in this case, not 900. Similarly, the height should be 200, not 900.
For simplicity and correctness, I would advocate for canvas being described as the intersecting area of the viewport and the provided rectangle.
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
Start with chapter 17, “Screen capture,” and inspect the “draw a bounding box from the framebuffer” algorithm and step 6. Verify how the viewport and rectangle dimensions determine the canvas; done means the specification clearly defines the viewport–rectangle intersection for the resulting canvas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100