Draw map boundary so it doesn't overlap the map #3835
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the top and left border of the map overlap tile pixels, while the right and bottom do not. This change adjusts the border to be outside the map on all four sides. This is especially helpful for pixel art maps at low zooms, where those overlapped pixels can matter quite a bit.
This change offsets the top left corner by -1,-1 with the assumption that the border is always 1px wide because I could not find any code that ever sets the pen width. If the pen width is dynamic, then this offset will need to be adjusted for the width.
I'm not 100% sure I'm using QRect.adjust() correctly (I half-expect the Qt docs to be lying about how it works), but I need an autobuild to check, hence the early PR :] Will edit after I've tested.
Edit: Ah, of course I failed to account for scaling! The (-1,-1,0,0) adjustment needs to happen to the scaled rect, not the original rect. The good news is QRect.adjust() works like I thought :D