From a4e7ac13c1988cfe8c38797b02aab458fadf0ccd Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 11 Jun 2021 10:45:49 -0300 Subject: [PATCH] Fix crash in Cel properties dialog when range is enabled & active cel is empty --- src/app/commands/cmd_cel_properties.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/commands/cmd_cel_properties.cpp b/src/app/commands/cmd_cel_properties.cpp index 82f81f544..68873ba01 100644 --- a/src/app/commands/cmd_cel_properties.cpp +++ b/src/app/commands/cmd_cel_properties.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020 Igara Studio S.A. +// Copyright (C) 2020-2021 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -191,20 +191,20 @@ private: } Sprite* sprite = m_document->sprite(); - const bool userDataChanged = (newUserData != m_cel->data()->userData()); for (Cel* cel : sprite->uniqueCels(range.selectedFrames())) { if (range.contains(cel->layer())) { if (!cel->layer()->isBackground() && newOpacity != cel->opacity()) { tx(new cmd::SetCelOpacity(cel, newOpacity)); } - if (userDataChanged && - newUserData != cel->data()->userData()) { + if (newUserData != cel->data()->userData()) { tx(new cmd::SetUserData(cel->data(), newUserData, m_document)); // Redraw timeline because the cel's user data/color // might have changed. - App::instance()->timeline()->invalidate(); + if (newUserData.color() != cel->data()->userData().color()) { + App::instance()->timeline()->invalidate(); + } } } }