AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.41k stars 290 forks source link

690 - Fixed incorrect tileset selection on resizing palette #722

Closed cowmanjoe closed 5 years ago

cowmanjoe commented 5 years ago

Very simple fix to #690. Essentially just a check whenever selected tiles are updated that they are within the bounds of the selectable tiles. If this isn't the case, the selection is deselected entirely.

ilexp commented 5 years ago

Moved your fix to a slightly different spot to make its intentions clearer and avoid running it in situations where it may not be needed. I also removed the areTilesSelected field set, as I suspect that this field is actually a UI interaction temp variable judging from the surrounding code.

Looks good overall, can verify it fixes the issue 👍