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

Zooming is wonky outside map bounds #3860

Open
eishiya opened this issue Dec 19, 2023 · 0 comments
Open

Zooming is wonky outside map bounds #3860

eishiya opened this issue Dec 19, 2023 · 0 comments
Labels
bug Broken behavior.

Comments

@eishiya
Copy link
Contributor

eishiya commented Dec 19, 2023

When zooming in/out, Tiled restricts the map view position so that it's not too far from the map bounds. This means that if a map has Objects far outside of the map bounds, it becomes very annoying to zoom on them, because Tiled keeps resetting the view closer to the map bounds.

Steps to Reproduce

  1. Create a Map. Leave the tile layer empty, or only populated in a small area.
  2. Create an Object Layer and add Objects far away outside the map bounds (or the tiles, in the case of an infinite map).
  3. Attempt to zoom in with the scroll wheel on the distant Objects.
  4. Observe that the map view frames an area closer to the map bounds, potentially nowhere near where you were trying to zoom.

Expectation
Tiled should zoom in on this distant area just the same as on anything within the map bounds.

In this gif, the map is infinite, but you can see the calculated map bounds as the green dot in the upper left.
tiled_zoomweirdness2

Proposed changes
When zooming, Tiled should not try to force the view to be within some bounds at all. If the user is zooming on some location, it's because they want to see it. Only apply the limits when Tiled initiates the zoom, e.g. when opening a map.
Alternatively, Tiled should take Objects and Image Layers (and their offsets) into account when calculating the effective bounds for the view, rather than only using the tile layer bounds.

Specifications:
Windows 10, Tiled 1.10.2 (me) and Windows 8.1, Tiled 1.10.1 (mingw, who reported this on Discord). I am sure this is a much older issue.

@eishiya eishiya added the bug Broken behavior. label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

1 participant