mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Don't destroy linked cels after moving the whole cel content (fix #1214)
This commit is contained in:
parent
2e14064ef7
commit
638206becd
@ -523,6 +523,8 @@ void MovingPixelsState::onBeforeCommandExecution(CommandExecutionEvent& ev)
|
||||
|
||||
// Clear floating pixels on Cut/Clear.
|
||||
if (command->id() != CommandId::Copy) {
|
||||
m_pixelsMovement->trim();
|
||||
|
||||
// Discard the dragged image.
|
||||
m_pixelsMovement->discardImage();
|
||||
m_discarded = true;
|
||||
|
@ -173,6 +173,16 @@ void PixelsMovement::rotate(double angle)
|
||||
update_screen_for_document(m_document);
|
||||
}
|
||||
|
||||
void PixelsMovement::trim()
|
||||
{
|
||||
ContextWriter writer(m_reader, 1000);
|
||||
|
||||
ASSERT(writer.cel());
|
||||
if (writer.cel() &&
|
||||
writer.cel()->layer()->isTransparent())
|
||||
m_transaction.execute(new cmd::TrimCel(writer.cel()));
|
||||
}
|
||||
|
||||
void PixelsMovement::cutMask()
|
||||
{
|
||||
{
|
||||
@ -180,10 +190,8 @@ void PixelsMovement::cutMask()
|
||||
if (writer.cel()) {
|
||||
m_transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
|
||||
ASSERT(writer.cel());
|
||||
if (writer.cel() &&
|
||||
writer.cel()->layer()->isTransparent())
|
||||
m_transaction.execute(new cmd::TrimCel(writer.cel()));
|
||||
// Do not trim here so we don't lost the information about all
|
||||
// linked cels related to "writer.cel()"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,7 @@ namespace app {
|
||||
|
||||
HandleType handle() const { return m_handle; }
|
||||
|
||||
void trim();
|
||||
void cutMask();
|
||||
void copyMask();
|
||||
void catchImage(const gfx::Point& pos, HandleType handle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user