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 in sometimes shifts focus away from zoomed area #2090

Closed
sano98 opened this issue Mar 21, 2019 · 6 comments

Comments

3 participants
@sano98
Copy link

commented Mar 21, 2019

When using mousewheel + STRG on the map-area (I'm not talking about the tileset editor as in #2039), sometimes the zoom focus is no longer on the area where the mouse cursor is.

But as in issue #2039, this is maybe best explained with a .gif:

Tiled Zoom Off Detail

I've marked some colored areas which I want to zoom on.
Note how it works for the first two squares in the grey part of the map, but when I try to zoom onto the 3rd square in the blue part, the focus constantly shifts to some area above my actual zoom target.
I then manually scroll back down and zoom further, but again, zoom focus is not where the mouse cursor is.

I'm not yet sure about what conditions cause the zoom to be off. I'm suspecting that it's somehow connected to the target zone being offset to the red-framed "normal" position of my map?

@bjorn

This comment has been minimized.

Copy link
Owner

commented Mar 22, 2019

I'm not yet sure about what conditions cause the zoom to be off. I'm suspecting that it's somehow connected to the target zone being offset to the red-framed "normal" position of my map?

Right, I suspect the same. Tiled sets a pretty large margin around the map that adjusts to the zoom level. But that means when zooming in, this margin gets smaller and can cause the view to scroll towards the map like is happening in your animation.

In your case, I think the fix would be for Tiled to take into account the layer offsets (which I guess you are using to put that layer outside of your map?), when calculating the map boundaries.

@bjorn bjorn added the bug label Mar 22, 2019

@sano98

This comment has been minimized.

Copy link
Author

commented Mar 25, 2019

Hey Bjorn,
yes, you are correct: We use the layer offset to arrange a set of different floors for our buildings maps:

VerticalSlice

Only the rooftop is located "within" the map; all lower floors have a y-offset.
Usage of layer-offset seemed natural to me, as we export each single floor separately - or are we abusing the offset for something it was never designed for?

Your idea for a fix sounds promising.

@bjorn bjorn added this to Tiled 1.2 (bugfixes) in Roadmap May 10, 2019

@bjorn bjorn closed this in c9047b4 May 15, 2019

Roadmap automation moved this from Tiled 1.2 (bugfixes) to Recently Completed May 15, 2019

@faulknermano

This comment has been minimized.

Copy link

commented Jun 25, 2019

Reporting this here because I think the bug is still there, though though the cause may be different.

Version

Using Tiled 1.2.4. Windows 7 SP1.

Problem

Zooming in on mouse cursor works between 5% up to 50% zoom. Beyond 50%, the zoom focus tends to go upper-left corner.

However, if the current view includes the upper-left corner of the map, then zooming works as expected

Video

Please see this video

  • No offset applied to map.
  • First part of video demonstrates zooming around the center of the map (i.e. upper-left corner of map is not visible). Notice it works when zooming between 5% to 50%.
  • Second part of video demonstrates when zooming around the upper-left corner of map (corner is visible). Zooming to any zoom level works.
  • This happens both with mouse wheel zoom or keyboard shortcut zoom.

Hope this helps. Thanks!

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jun 25, 2019

@faulknermano A few questions since I've not seen this behavior: Does this happen consistently? Does it happen with all maps (or, can you attach yours so I can see if I can reproduce it with that one)? Did this happen with previous Tiled versions as well?

@faulknermano

This comment has been minimized.

Copy link

commented Jun 25, 2019

@bjorn It happens consistently. It happens on all maps, even a new default map of 32x32. I've just tried v1.2.2 and v1.2.3 and the bug is not present in those versions. It is only present in v1.2.4.

@faulknermano

This comment has been minimized.

Copy link

commented Jun 25, 2019

Addition: I don't know if it matters, but I'm on a laptop at 1280x800 resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.