mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Fix crash when we press Del key to completely delete a cel
This commit is contained in:
parent
a2712d440d
commit
eec2904974
@ -509,7 +509,10 @@ bool DocumentView::onClear(Context* ctx)
|
||||
{
|
||||
Transaction transaction(writer.context(), "Clear");
|
||||
transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
transaction.execute(new cmd::TrimCel(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 &&
|
||||
!Preferences::instance().selection.keepSelectionAfterClear())
|
||||
|
@ -179,7 +179,10 @@ void PixelsMovement::cutMask()
|
||||
ContextWriter writer(m_reader, 1000);
|
||||
if (writer.cel()) {
|
||||
m_transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
m_transaction.execute(new cmd::TrimCel(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()));
|
||||
transaction.execute(new cmd::TrimCel(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