-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
multi-squares in multi-squares in ... #362
Conversation
I changed the splitCellToDiagram and the updatePaddleRule function to go recursivcely through all diagrams. Also empty cells in a diagram get replaced with a cell.
If a cell on both sides are split the same they only get recoloured. If they are split the same but they have a different multi-multi cell structure it still merges and splits. eg: left has a 1x4 multicell and right has 1x2 multi cell with 1x2 multi cells in it. That still doesn't work.
✅ Deploy Preview for keen-boyd-1443aa ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey this looks great. i'll pop in some questions slowly over time |
and sorry im so slow :) |
if (a.x + 128 < b.x + 128) return -1 | ||
if (a.x + 128 > b.x + 128) return 1 | ||
if (a.y + 128 < b.y + 128) return -1 | ||
if (a.y + 128 > b.y + 128) return 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it to round the numbers by a bit. So if the bottom cell was .000000001 more to the left it wouldn't be before the top.
I don't fully know how i got a cell that was a bit offset, so don't know if it can still happen / it would be a better idea to round it somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh fantastic good idea!
yes I think it would be better to do this change at cell creation time, rather than during this hot function, but i am happy to merge the PR as it is and we can see
Did this a while ago, but wanted to find a neater solution. Didn't find one and forgot to do it so ill just PR it now if you want to use it.
I did:
Stuff i am not happy with/ is janky:
flattenAndFillDiagramCells
it flattens nested cells and fills the voids.addDiagramCellsToLeftList
it does the same but for rule gen on the left side. Also it returns what structure the nested cell had.addDiagramCellsToRightList
it does the same but for rule gen on the right side and it uses the structure to tell when merge/splitsplitCellToDiagram
function).