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

[Bug]: Moving the viewport using Ctrl+arrow keys is inconsistent #5070

Open
kwvanderlinde opened this issue Nov 25, 2024 · 1 comment
Open
Labels

Comments

@kwvanderlinde
Copy link
Collaborator

Describe the Bug

When using the keybindings for moving the viewport by whole cells, the viewport is not only moved by a cell count but also snapped so that the top-left corner of the viewport lies exactly on a cell border. The direction of this snapping depends on the sign of the coordinates of the top-left corner, resulting in inconsistencies in situations that appear identical to the user.

To Reproduce

  1. Create a blank map with a square grid. Bonus points for having a solid color background.
  2. Drop a Medium sized token on cell (1, 1). This will serve as a visual reference.
  3. Set zoom to 100% and drag the map so the top-left of the viewport is approximately at the center of cell (0, 0).
  4. Press Ctrl+Left. Notice the viewport is moved up-left by about half a cell (alternatively, the map is moved down-right by that amount).
  5. Now move the token to cell (-1, -1), and reposition the map so the center of cell (-2, -2) is about at the top-left corner. This should visually be similar to the setup in (3).
  6. Press Ctrl+Left. Notice this time the viewport moves left by half a cell, but also moves down half a cell, unlike in (4).

Expected Behaviour

Snapping should be consistent regardless of where the top-left corner of the viewport is.

Screenshots

In steps (4) and (6), this is what the set up looks like:
image

MapTool Info

1.15.2

Desktop

Linux Mint 22

Additional Context

No response

@kwvanderlinde
Copy link
Collaborator Author

Going beyond the bug itself, my preference would be that we don't do any snapping for Ctrl+arrow, instead always moving by whole cells. In my mind, there's nothing particularly special about the top-left corner that we should aim to align it with a grid cell.

If that opinion isn't widely shared, then at least it would be nice if snapping only applied in the direction of movement. I.e., Ctrl+Left would not disturb the viewport vertically, only horizontally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant