RectpackSharp icon indicating copy to clipboard operation
RectpackSharp copied to clipboard

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

Open pkhead opened this issue 7 months ago • 1 comments

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.

pkhead avatar Jul 28 '24 03:07 pkhead