1
0
mirror of https://github.com/aseprite/aseprite.git synced 2025-04-02 13:20:12 +00:00

Fix reducing background layer bounds on indexed mode after applying a filter

This commit is contained in:
David Capello 2016-12-07 11:55:56 -03:00
parent 315584d819
commit 09ee71dede

@ -10,7 +10,7 @@
#include "app/commands/filters/filter_manager_impl.h"
#include "app/cmd/copy_rect.h"
#include "app/cmd/copy_region.h"
#include "app/cmd/patch_cel.h"
#include "app/cmd/unlink_cel.h"
#include "app/context_access.h"
@ -189,6 +189,15 @@ void FilterManagerImpl::apply(Transaction& transaction)
gfx::Rect output;
if (algorithm::shrink_bounds2(m_src.get(), m_dst.get(),
m_bounds, output)) {
if (m_cel->layer()->isBackground()) {
transaction.execute(
new cmd::CopyRegion(
m_cel->image(),
m_dst.get(),
gfx::Region(output),
position()));
}
else {
// Patch "m_cel"
transaction.execute(
new cmd::PatchCel(
@ -198,6 +207,7 @@ void FilterManagerImpl::apply(Transaction& transaction)
}
}
}
}
void FilterManagerImpl::applyToTarget()
{