Add order enforcement in stack process #854
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
includes creation of group parameter
shouldStackEnforceOrder
Issue Number
In some cases, it is important to enforce the order of items in the same group because they are not of the same type.
In the images below, I have added a few items which are meant to be stacked, but the first two red items are related to the first blue item, the next two red items to the next blue item, and the last red item to the last blue item.
With the current code, what we get does not enforce this order (and there is no way to enforce it)
This PR makes sure that an item cannot be above an item which is in horizontal collision.
The resulting screenshot is the following:
Overview of PR
This PR creates a new group parameter "shouldStackEnforceOrder".
Clearly, this parameter depends upon isStacked. If isStacked is undefined or false, this new parameter has no effect.
If shouldStackEnforceOrder is defined and true for a group, it uses a slightly modified collision method which ensures order is enforced, as shown on the screenshots above.