Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix container dimensions #33447

Merged
merged 4 commits into from
Jun 9, 2024
Merged

Fix container dimensions #33447

merged 4 commits into from
Jun 9, 2024

Conversation

rezabet
Copy link
Contributor

@rezabet rezabet commented May 6, 2024

This commit fixes a spacing issue observed when looking at the full Pacman canvas.

The new dimension values chosen are not random, they were calculated so that:

  • The spacing on the x- and y-axis between the inner and outer container rectangles are the same.
  • The spacing on the x- and y-axis between the inner container rectangle and the nearest object (pacman and 2 inner rectangles) are the same.

It additionally adjusts the height of the canvas so the full image can be in-view.

Before:
image
After:
image

Disclaimer:
The image on the site looks like this:
image
Which looks OK but I suspect it has been intentionally cropped to due to the dimension misalignment? Or is that not the case?

See https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#making_combinations for more details.

This commit fixes a spacing issue observed when looking at the full Pacman canvas.

The new dimension values chosen are not random, they were calculated so that:
- The spacing on the x- and y-axis between the inner and outer container rectangles are the same.
- The spacing on the x- and y-axis between the inner container rectangle and the nearest object (pacman and 2 inner rectangles) are the same.

It additionally adjusts the height of the canvas so the full image can be in-view.
@rezabet rezabet requested a review from a team as a code owner May 6, 2024 18:06
@rezabet rezabet requested review from sideshowbarker and removed request for a team May 6, 2024 18:06
@github-actions github-actions bot added Content:WebAPI Web API docs size/s 6-50 LoC changed labels May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

Preview URLs

(comment last updated: 2024-06-09 19:56:54)

@sideshowbarker sideshowbarker removed their request for review May 7, 2024 03:21
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Thanks :)

@Josh-Cena Josh-Cena merged commit 2acd54a into mdn:main Jun 9, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants