Skip to content
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

add new grid direction #481

Closed
wants to merge 1 commit into from
Closed

Conversation

sabrine33
Copy link
Contributor

No description provided.

@sabrine33 sabrine33 self-assigned this Nov 21, 2024
Copy link
Contributor

@khelwood khelwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is DownLeft direction related to a 180º rotation?

@sabrine33
Copy link
Contributor Author

How is DownLeft direction related to a 180º rotation?

I found the naming a bit confusing. I tried to align the logic with the existing names, which made sense to me at some point. There are additional details on the client side, but I’m happy to discuss this further if it’s still unclear.

@khelwood
Copy link
Contributor

khelwood commented Nov 21, 2024

@sabrine33 Going by this code in client:

case GridDirection.DownLeft:
      // Reverse row-major order (bottom to top, right to left) // Rotate 180 degrees
      for (let row = numRows; row >= 1; row--) {
        for (let col = numColumns; col >= 1; col--) {
          addresses.push(createAddress(row, col));
        }
      }
      break;

this direction should be named LeftUp. From the starting position, to get to the next slots you go Left, and when you've gone all the way left you move Up.

If it's possible to support this requirement in the client without altering core.GridDirection, that might be better. core.GridDirection is coupled to the GridDirection used by storage locations in Storelight.

@sabrine33
Copy link
Contributor Author

@sabrine33 Going by this code in client:

case GridDirection.DownLeft:
      // Reverse row-major order (bottom to top, right to left) // Rotate 180 degrees
      for (let row = numRows; row >= 1; row--) {
        for (let col = numColumns; col >= 1; col--) {
          addresses.push(createAddress(row, col));
        }
      }
      break;

this direction should be named LeftUp. From the starting position, to get to the next slots you go Left, and when you've gone all the way left you move Up.

If it's possible to support this requirement in the client without altering core.GridDirection, that might be better. core.GridDirection is coupled to the GridDirection used by storage locations in Storelight.

Thank you! I will update the PR and decouple it from the core, I was not aware that this is mainly for storlight

@sabrine33 sabrine33 closed this Nov 21, 2024
@sabrine33 sabrine33 deleted the x1254-add-new-gridDirection branch November 21, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants