-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Update ex.BoundingBox to have an additional option based constructor #1151
Comments
Is it ok for me to make this change? I don't have a ton of TS experience, but doing a bit of research it's really too bad it can't allow multiple constructor implementations, that's definitely the way I would go in another language to avoid the awkward use of the union typed leftOrOptions. |
@JeTmAn1981 all yours! |
I've written the new constructor. Regarding tests, the bounding box spec is prefacing all the tests with a call to the old-style constructor: describe('A Bounding Box', () => { Would you like all the subsequent tests to be run for both construction styles (options parameter vs. individually specified coordinate parameters)? If so, is there a way of referencing the existing tests without having to create a new spec file with that code copied over? The only thing that would really need to change is how the constructor is called. |
Another couple of questions:
|
…s in an object. Updated constructor is backwards compatible, still allows users to call it with coordinates as individual parameters. Main bounding box tests run for boxes constructed using both methods. Resolves: excaliburjs#1151.
…s in an object. Updated constructor is backwards compatible, still allows users to call it with coordinates as individual parameters. Main bounding box tests run for boxes constructed using both methods. Add new interface for specifying the type of the coordinate parameters object. Resolves: excaliburjs#1151.
Ok, I went ahead and created a pull request for what I came up with on this. Let me know how it looks! |
Huzzah! So nice to find something small to make a contribution with that gets accepted quickly :) |
Context
Currently,
ex.BoundingBox
has a 4 arg parameter list constructor which technically violates the styleguideProposal
Create an option back constructor for
ex.BoundingBox
and preserve the old constructor for backwards compatibility.Acceptance Criteria
Added
sectionThe text was updated successfully, but these errors were encountered: