Fix crash drawing on empty tile layer in manual mode (fix #5620)#5732
Fix crash drawing on empty tile layer in manual mode (fix #5620)#5732miguelfabiao125-bit wants to merge 1 commit into
Conversation
|
Hi there! One or more of the commit messages in this PR do not match our code submission policy, please check the |
3e25063 to
90a409e
Compare
Upon investigating the cell-addition logic for tilemap layers, I found that Manual Mode was creating new cels without properly attaching them. While PR aseprite#5720 resolved the immediate crash, the first interaction in Manual Mode was still incorrectly committing a tile. To resolve this, I implemented an early exit within the commit function to bypass the data-writing process when in Manual Mode. However, this initially prevented the preview layer from being cleared. To ensure a consistent UI state, I updated drawing_state to explicitly clean the preview buffer when the drawing loop is destroyed. This ensures that "ghost" pixels are removed even when a commit is opted out. I have also added a test to make sure no other crash or tile creation is added by the manual tilemode in the future.
90a409e to
e584ed9
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Thanks @miguelfabiao125-bit for this PR. Although this fixes the manual mode to avoid committing/adding new tiles, I'm not sure if we should show the preview at all. For example, if we already have a tilemap defined, the manual mode doesn't paint outside the tilemap area, so in the initial case we shouldn't show/preview nothing, probably showing a forbidden icon just like if the layer is locked. |
Upon investigating the cell-addition logic for tilemap layers, I found that Manual Mode was creating new cels without properly attaching them. While PR #5720 resolved the immediate crash, the first interaction in Manual Mode was still incorrectly committing a tile.
To resolve this, I implemented an early exit within the commit function to bypass the data-writing process when in Manual Mode. However, this initially prevented the preview layer from being cleared.
To ensure a consistent UI state, I updated drawing_state to explicitly clean the preview buffer when the drawing loop is destroyed. This ensures that "ghost" pixels are removed even when a commit is opted out.
I declare that my contributions are not co-authored using a generative AI technology.
I agree that my contributions are licensed under the Individual Contributor License Agreement V4.0 ("CLA") as stated in https://github.com/igarastudio/cla/blob/main/cla.md
I have signed the CLA following the steps given in https://github.com/igarastudio/cla#signing