Skip to content

Conversation

wadetb
Copy link
Contributor

@wadetb wadetb commented Dec 2, 2019

  • When trying to select across the edge of the map, the selection
    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.

- When trying to select across the edge of the map, the selection
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.
@wadetb
Copy link
Contributor Author

wadetb commented Dec 2, 2019

Here are some quick GIFs of the bugs:
map1
map2
map3

@wadetb
Copy link
Contributor Author

wadetb commented Dec 2, 2019

And the fixes:
newmap1
newmap2

Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!
you fixed a really annoying bug
thank you

@nesbox nesbox merged commit 1134ac0 into nesbox:master Dec 2, 2019
@nesbox nesbox added the bug label Dec 2, 2019
@nesbox nesbox added this to the 0.80.0 milestone Dec 2, 2019
@nesbox nesbox removed this from the 0.80.0 milestone Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants