fix: inverted push direction #955
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.
Hey, I was trying to fix #933.
What I notices is that the grid starts a recursive chain to pushes all items to the north and once it hit the border it works it self back from the top checking all the other possible solutions -> Leading to Number 1 being pushed down by Number 2 creating the swap effect.
There are multiple solution how this could be solved. E.g. we could track if the push would collide with there chained pushed coming from the opposite direction.
But I was wondering what is the use case for this last check? In the code you are checking for swap in a separate function so there should not really be a need to check for a push in the direction you are coming from.
Can you please give a small example? Otherwise the code attach will fix the issue.
I create a patch file to test the issue. After applying you can find the test view under the path "/test"
add_test_view.patch