You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the addArray function only accepts types extended from IRectangle. This appears to be an issue because IRectangle includes values that should not be set during addition of rectangles (such as x and y).
e.g.
// packer: MaxRectsPacker<IRectangle>packer.addArray([{width: 1,height: 1}])// Type '{ width: number; height: number; }' is missing the following properties from type 'IRectangle': x, y ts(2739)
I think the generic needs to be more narrowed to something like
It appears that the
addArray
function only accepts types extended fromIRectangle
. This appears to be an issue becauseIRectangle
includes values that should not be set during addition of rectangles (such asx
andy
).e.g.
I think the generic needs to be more narrowed to something like
perhaps porting the tests to typescript would catch this?
Thanks for making this lib either way 🙏
The text was updated successfully, but these errors were encountered: