Skip to content

Commit

Permalink
fix: fix crash when remove empty cell in animate tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelesaux committed Feb 17, 2022
1 parent 1591214 commit 3feebc0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/martine-ui/animateTab.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ func (m *MartineUI) newAnimateTab(a *menu.AnimateMenu) fyne.CanvasObject {
removeButton := widget.NewButtonWithIcon("Remove", theme.DeleteIcon(), func() {
fmt.Printf("image index to remove %d\n", a.ImageToRemoveIndex)
images := a.AnimateImages.Images()
if len(images[0]) <= a.ImageToRemoveIndex {
return
}
images[0] = append(images[0][:a.ImageToRemoveIndex], images[0][a.ImageToRemoveIndex+1:]...)
canvasImages := make([][]canvas.Image, 0)
for i := 0; i < len(images); i++ {
Expand Down

0 comments on commit 3feebc0

Please sign in to comment.