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 problems with Bound #215

Merged
merged 1 commit into from May 19, 2024
Merged

Fix problems with Bound #215

merged 1 commit into from May 19, 2024

Conversation

ii41
Copy link
Contributor

@ii41 ii41 commented May 7, 2024

  1. Group.toBound's return type was wrongly marked Group. Closes Group.toBound's return type wrongly marked as Group #214
  2. Bound stores top left and bottom right Pts separately. Close Bound's bottom right pt isn't updated after calling e.g. add #213

For 2, top left and bottom right Pts were separate from Pts that are indexable using integers.

This causes that, when a calculation method such as add inherited from Group is used on a Bound, the Bound's corner Ptss are sometimes not updated, as Group uses integer indices for getting the member Pts.

In order to fix this, the separate members _topLeft and _bottomRight are removed from Bound. topLeft and bottomRight are now just getters for integer-indexable Pts.

1. `Group.toBound`'s return type was wrongly marked `Group`. Closes williamngan#214
2. `Bound` stores top left and bottom right `Pt`s separately. Close williamngan#213

For 2, top left and bottom right `Pt`s were separate from `Pt`s that are
indexable using integers.

This causes that, when a calculation method such as `add` inherited from
`Group` is used on a `Bound`, the `Bound`'s corner `Pts`s are sometimes
not updated, as `Group` uses integer indices for getting the member
`Pt`s.

In order to fix this, the separate members `_topLeft` and `_bottomRight`
are removed from `Bound`. `topLeft` and `bottomRight` are now just
getters for integer-indexable `Pt`s.
Copy link

netlify bot commented May 7, 2024

Deploy Preview for astronaut-horse-32874 ready!

Name Link
🔨 Latest commit c03d89c
🔍 Latest deploy log https://app.netlify.com/sites/astronaut-horse-32874/deploys/663a768dc1f9a4000878d399
😎 Deploy Preview https://deploy-preview-215--astronaut-horse-32874.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@williamngan
Copy link
Owner

@ii41 - Thank you so much for catching this bug and providing such a great fix too. Really appreciate it!

@williamngan williamngan merged commit 5d8e12f into williamngan:master May 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants