Skip to content

Fix setting wrong layer index when deleting top layer - #2397

Open
rrivvi wants to merge 1 commit into
PintaProject:masterfrom
rrivvi:master
Open

rrivvi wants to merge 1 commit into
PintaProject:masterfrom
rrivvi:master

Conversation

@rrivvi

@rrivvi rrivvi commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2387
Repro: create new document, create new layer, delete topmost layer

If supplied deleting index is the same as the selected layer, it doesnt decrement the current index

For layers in between and the bottom layer, this results in selecting the layer above instead of the one below, but doesnt become out of bounds

Description of Changes

This change accounts for when the selected index and deleted index are the same and they're the top most layer, so that the newly selected layer index doesnt become out of bounds

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pinta crashes with "Index was out of range" when I try to use "Merge Layer Down"

1 participant