Map view fixes when wrapping around the edge #968
Merged
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.
rectangle no longer jumps and stretches across the entire map.
The mouse coordinates were being normalized prior to expanding the
selection extent, so for example a 1,1 start point and a -1,-1 end point
would evaluate to 1,1..W-1,H-1, turning a 2x2 selection into the entire
map!.
It's actually fine for the selection rectangle to go outside the valid
range because the copy/paste functions all normalize the individual
gets/sets.
Don't allow scrolling into negative offsets in the world view. This
breaks the grid drawing code temporarily when you switch back to the
map.
When the map rectangle wraps around in the world view, draw all the
wrapped quadrants. This makes it clearer how the map wraps around and
avoids "losing" the viewport when you scroll slightly left or up.