mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Fix crash when we press Del key to completely delete a cel
This commit is contained in:
parent
a2712d440d
commit
eec2904974
@ -509,6 +509,9 @@ bool DocumentView::onClear(Context* ctx)
|
||||
{
|
||||
Transaction transaction(writer.context(), "Clear");
|
||||
transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
|
||||
// If the cel wasn't deleted by cmd::ClearMask, we trim it.
|
||||
if (writer.cel())
|
||||
transaction.execute(new cmd::TrimCel(writer.cel()));
|
||||
|
||||
if (visibleMask &&
|
||||
|
@ -179,6 +179,9 @@ void PixelsMovement::cutMask()
|
||||
ContextWriter writer(m_reader, 1000);
|
||||
if (writer.cel()) {
|
||||
m_transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
|
||||
ASSERT(writer.cel());
|
||||
if (writer.cel())
|
||||
m_transaction.execute(new cmd::TrimCel(writer.cel()));
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,11 @@ void cut(ContextWriter& writer)
|
||||
{
|
||||
Transaction transaction(writer.context(), "Cut");
|
||||
transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
|
||||
ASSERT(writer.cel());
|
||||
if (writer.cel())
|
||||
transaction.execute(new cmd::TrimCel(writer.cel()));
|
||||
|
||||
transaction.execute(new cmd::DeselectMask(writer.document()));
|
||||
transaction.commit();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user