mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-15 19:52:05 +00:00
Use a Tx instead of a Transaction on FilterManagerImpl (fix #2108)
This commit is contained in:
parent
6c7f1ff05b
commit
655ce92836
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -214,7 +215,7 @@ void FilterManagerImpl::apply()
|
||||
if (algorithm::shrink_bounds2(m_src.get(), m_dst.get(),
|
||||
m_bounds, output)) {
|
||||
if (m_cel->layer()->isBackground()) {
|
||||
m_transaction->execute(
|
||||
(*m_tx)(
|
||||
new cmd::CopyRegion(
|
||||
m_cel->image(),
|
||||
m_dst.get(),
|
||||
@ -223,7 +224,7 @@ void FilterManagerImpl::apply()
|
||||
}
|
||||
else {
|
||||
// Patch "m_cel"
|
||||
m_transaction->execute(
|
||||
(*m_tx)(
|
||||
new cmd::PatchCel(
|
||||
m_cel, m_dst.get(),
|
||||
gfx::Region(output),
|
||||
@ -278,7 +279,7 @@ void FilterManagerImpl::applyToTarget()
|
||||
// Initialize writting operation
|
||||
ContextReader reader(m_context);
|
||||
ContextWriter writer(reader);
|
||||
m_transaction.reset(new Transaction(writer.context(), m_filter->getName(), ModifyDocument));
|
||||
m_tx.reset(new Tx(writer.context(), m_filter->getName(), ModifyDocument));
|
||||
|
||||
m_progressBase = 0.0f;
|
||||
m_progressWidth = (cels.size() > 0 ? 1.0f / cels.size(): 1.0f);
|
||||
@ -289,7 +290,7 @@ void FilterManagerImpl::applyToTarget()
|
||||
if (paletteChange) {
|
||||
Palette newPalette = *getNewPalette();
|
||||
restoreSpritePalette();
|
||||
m_transaction->execute(
|
||||
(*m_tx)(
|
||||
new cmd::SetPalette(m_site.sprite(),
|
||||
m_site.frame(), &newPalette));
|
||||
}
|
||||
@ -320,15 +321,15 @@ void FilterManagerImpl::applyToTarget()
|
||||
|
||||
bool FilterManagerImpl::isTransaction() const
|
||||
{
|
||||
return m_transaction != nullptr;
|
||||
return m_tx != nullptr;
|
||||
}
|
||||
|
||||
// This must be executed in the main UI thread.
|
||||
// Check Transaction::commit() comments.
|
||||
void FilterManagerImpl::commitTransaction()
|
||||
{
|
||||
ASSERT(m_transaction);
|
||||
m_transaction->commit();
|
||||
ASSERT(m_tx);
|
||||
m_tx->commit();
|
||||
}
|
||||
|
||||
void FilterManagerImpl::flush()
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -10,6 +11,7 @@
|
||||
|
||||
#include "app/commands/filters/cels_target.h"
|
||||
#include "app/site.h"
|
||||
#include "app/tx.h"
|
||||
#include "base/exception.h"
|
||||
#include "doc/image_impl.h"
|
||||
#include "doc/image_ref.h"
|
||||
@ -38,7 +40,6 @@ namespace app {
|
||||
class Context;
|
||||
class Doc;
|
||||
class Editor;
|
||||
class Transaction;
|
||||
|
||||
using namespace filters;
|
||||
|
||||
@ -149,7 +150,7 @@ namespace app {
|
||||
Target m_target; // Filtered targets
|
||||
CelsTarget m_celsTarget;
|
||||
std::unique_ptr<doc::Palette> m_oldPalette;
|
||||
std::unique_ptr<Transaction> m_transaction;
|
||||
std::unique_ptr<Tx> m_tx;
|
||||
|
||||
// Hooks
|
||||
float m_progressBase;
|
||||
|
Loading…
Reference in New Issue
Block a user