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
Group.toBound
's return type wrongly marked as Group
#214
Comments
ii41
added a commit
to ii41/pts
that referenced
this issue
May 7, 2024
…illiamngan#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.
ii41
added a commit
to ii41/pts
that referenced
this issue
May 7, 2024
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.
Merged
williamngan
pushed a commit
that referenced
this issue
May 19, 2024
1. `Group.toBound`'s return type was wrongly marked `Group`. Closes #214 2. `Bound` stores top left and bottom right `Pt`s separately. Close #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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a convenience method for creating a Bound from a group, this wrong type annotation makes it less convenient... Type check wrongly complains about passing a
Group
where aBound
is expected and we don't get completion onBound
's members.pts/src/Pt.ts
Lines 946 to 947 in 47de4b7
The text was updated successfully, but these errors were encountered: