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

Specific exception class for when the packing algorithm could not find a solution #8

Open
pkhead opened this issue Jul 28, 2024 · 1 comment

Comments

@pkhead
Copy link

pkhead commented Jul 28, 2024

This is a pretty neat library, but I have one minor qualm about it. It would be nice if, in the case where the pack function could not find a solution, it threw a specific type of exception instead of the generic System.Exception. That way, I can catch that exception specifically and potentially not something else that would be more exceptional.

Additionally, the exception message is misleading in the case where the pack function could not find the solution because it was limited by the specified max bounds size. None of my rectangles were anywhere close to uint.MaxValue, and I used the default stepSize.

And on the topic of the fail case, another thing I found annoying is that what the pack function even does when it couldn't find a solution isn't even documented. I mean, it's not something that seems rare, given the fact that you can choose the maximum bounds of the packed rectangle. I would appreciate it if that was changed.

@ThomasMiz
Copy link
Owner

Fair request, will do in the next release. Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants