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
Fit map in view does not work when tile size is 1 #3524
Comments
Looking at the code, this behaviour is intentional: Lines 157 to 165 in 48c4f85
However, I'd also rather see the map zoomed out, even if that means lag. The main use of Fit Map in View is to deal with large maps, I feel. A performance hit is an acceptable price, especially since users who find this feature not working as expected for large maps are likely to zoom out anyway. |
Yep - I would agree that the performance hit is acceptable. Maybe this could be on a user preference setting? "Allow large fit in view" |
I have implemented this on a local build and will generate a branch and pull-request when I have time. |
- The discussion here mapeditor#3524 - An additional check box has been added to the preferences.ui view and preferencesdialog.cpp - The parameter is exposed within mapview.h as noZoomLimitEnabled - The new parameter is used in mapview.cpp to enable or disable the use of scale limiting
I'm not even sure this needs to be a user preference, it seems like clutter to me. I think users working with large maps expect some performance hitches sometimes, and all this option does is make Fit Map in View not do what it says. I think users for who this performance optimization might make a positive difference would quickly learn not to use Fit Map in View at all :'D |
Yep - I'm tempted to agree. Is the Fit Map in View ever called outside of user control? e.g. when opening a map for the first time? |
Not that I can find. fitInView() and fitMapInView() are only called via the action. When creating or opening new maps, Tiled seems to use 100% zoom centred on 0,0. |
Okay - Shall I amend my commit request to remove the user settings and make the feature work without restrictions? |
I think it would be good to hear @bjorn's opinion, perhaps there's some reason for the performance mindfulness that we've both overlooked. |
Yes, in this piece of code: Lines 461 to 468 in 7fa253f
If needed, we can of course differentiate between the automatic version and the manual action, such that only the automatic case has a minimum zoom level. I would personally also like to avoid adding an option for this. |
Describe the bug
The "Fit Map In View" function does not work when there is a high tile count. (e.g. 600 x 400 tiles at a tile width height of 8x8)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that any configuration of map tile size and width/height would be able to be scaled to fit within the view when Fit Map To View is actioned.
Specifications:
The text was updated successfully, but these errors were encountered: