mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Use Tx instead of Transaction on PixelsMovement
This commit is contained in:
parent
1ae29dfc3c
commit
04d547ce37
@ -61,7 +61,7 @@ PixelsMovement::PixelsMovement(
|
||||
, m_document(site.document())
|
||||
, m_sprite(site.sprite())
|
||||
, m_layer(site.layer())
|
||||
, m_transaction(context, operationName)
|
||||
, m_tx(context, operationName)
|
||||
, m_setMaskCmd(nullptr)
|
||||
, m_isDragging(false)
|
||||
, m_adjustPivot(false)
|
||||
@ -197,7 +197,7 @@ void PixelsMovement::trim()
|
||||
// (Ctrl+V) and cut (Ctrl+X) the floating pixels.
|
||||
if (writer.cel() &&
|
||||
writer.cel()->layer()->isTransparent())
|
||||
m_transaction.execute(new cmd::TrimCel(writer.cel()));
|
||||
m_tx(new cmd::TrimCel(writer.cel()));
|
||||
}
|
||||
|
||||
void PixelsMovement::cutMask()
|
||||
@ -205,7 +205,7 @@ void PixelsMovement::cutMask()
|
||||
{
|
||||
ContextWriter writer(m_reader, 1000);
|
||||
if (writer.cel()) {
|
||||
m_transaction.execute(new cmd::ClearMask(writer.cel()));
|
||||
m_tx(new cmd::ClearMask(writer.cel()));
|
||||
|
||||
// Do not trim here so we don't lost the information about all
|
||||
// linked cels related to "writer.cel()"
|
||||
@ -515,7 +515,7 @@ void PixelsMovement::stampImage()
|
||||
// portion of sprite.
|
||||
ExpandCelCanvas expand(
|
||||
m_site, m_site.layer(),
|
||||
TiledMode::NONE, m_transaction,
|
||||
TiledMode::NONE, m_tx,
|
||||
ExpandCelCanvas::None);
|
||||
|
||||
// We cannot use cel->bounds() because cel->image() is nullptr
|
||||
@ -589,7 +589,7 @@ void PixelsMovement::dropImage()
|
||||
stampImage();
|
||||
|
||||
// This is the end of the whole undo transaction.
|
||||
m_transaction.commit();
|
||||
m_tx.commit();
|
||||
|
||||
// Destroy the extra cel (this cel will be used by the drawing
|
||||
// cursor surely).
|
||||
@ -604,10 +604,10 @@ void PixelsMovement::discardImage(const CommitChangesOption commit,
|
||||
|
||||
// Deselect the mask (here we don't stamp the image)
|
||||
if (keepMask == DontKeepMask)
|
||||
m_transaction.execute(new cmd::DeselectMask(m_document));
|
||||
m_tx(new cmd::DeselectMask(m_document));
|
||||
|
||||
if (commit == CommitChanges)
|
||||
m_transaction.commit();
|
||||
m_tx.commit();
|
||||
|
||||
// Destroy the extra cel and regenerate the mask boundaries (we've
|
||||
// just deselect the mask).
|
||||
@ -811,7 +811,7 @@ void PixelsMovement::updateDocumentMask()
|
||||
{
|
||||
if (!m_setMaskCmd) {
|
||||
m_setMaskCmd = new cmd::SetMask(m_document, m_currentMask);
|
||||
m_transaction.execute(m_setMaskCmd);
|
||||
m_tx(m_setMaskCmd);
|
||||
}
|
||||
else
|
||||
m_setMaskCmd->setNewMask(m_currentMask);
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "app/context_access.h"
|
||||
#include "app/extra_cel.h"
|
||||
#include "app/site.h"
|
||||
#include "app/transaction.h"
|
||||
#include "app/tx.h"
|
||||
#include "app/ui/editor/handle_type.h"
|
||||
#include "base/shared_ptr.h"
|
||||
#include "doc/algorithm/flip_type.h"
|
||||
@ -127,7 +127,7 @@ namespace app {
|
||||
Doc* m_document;
|
||||
Sprite* m_sprite;
|
||||
Layer* m_layer;
|
||||
Transaction m_transaction;
|
||||
Tx m_tx;
|
||||
cmd::SetMask* m_setMaskCmd;
|
||||
bool m_isDragging;
|
||||
bool m_adjustPivot;
|
||||
|
Loading…
x
Reference in New Issue
Block a user