Skip to content

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

Description

@pkhead

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions