mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
Remove undo_new/free/enable/disable/is_enabled/is_disabled, add Undo::is/setEnabled.
This commit is contained in:
parent
752ffa6444
commit
12ce788d11
@ -142,7 +142,7 @@ void CelPropertiesCommand::onExecute(Context* context)
|
||||
/* the opacity was changed? */
|
||||
if (cel_writer != NULL &&
|
||||
cel_writer->opacity != new_opacity) {
|
||||
if (undo_is_enabled(sprite_writer->getUndo())) {
|
||||
if (sprite_writer->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite_writer->getUndo(), "Cel Opacity Change");
|
||||
undo_int(sprite_writer->getUndo(), (GfxObj *)cel_writer, &cel_writer->opacity);
|
||||
}
|
||||
|
@ -68,14 +68,14 @@ void DuplicateLayerCommand::onExecute(Context* context)
|
||||
static Layer* duplicate_layer(Sprite* sprite)
|
||||
{
|
||||
/* open undo */
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Layer Duplication");
|
||||
undo_open(sprite->getUndo());
|
||||
}
|
||||
|
||||
Layer* layer_copy = sprite->getCurrentLayer()->duplicate_for(sprite);
|
||||
if (!layer_copy) {
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_close(sprite->getUndo());
|
||||
|
||||
Console console;
|
||||
@ -88,12 +88,12 @@ static Layer* duplicate_layer(Sprite* sprite)
|
||||
layer_copy->setName(layer_copy->getName() + " Copy");
|
||||
|
||||
/* add the new layer in the sprite */
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_layer(sprite->getUndo(), sprite->getCurrentLayer()->get_parent(), layer_copy);
|
||||
|
||||
sprite->getCurrentLayer()->get_parent()->add_layer(layer_copy);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_move_layer(sprite->getUndo(), layer_copy);
|
||||
undo_set_layer(sprite->getUndo(), sprite);
|
||||
undo_close(sprite->getUndo());
|
||||
|
@ -75,7 +75,7 @@ void InvertMaskCommand::onExecute(Context* context)
|
||||
CurrentSpriteWriter sprite(context);
|
||||
|
||||
/* undo */
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Mask Invert");
|
||||
undo_set_mask(sprite->getUndo(), sprite);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ void LoadMaskCommand::onExecute(Context* context)
|
||||
static_cast<const char*>(m_filename.c_str()));
|
||||
|
||||
// undo
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Mask Load");
|
||||
undo_set_mask(sprite->getUndo(), sprite);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ void MaskAllCommand::onExecute(Context* context)
|
||||
CurrentSpriteWriter sprite(context);
|
||||
|
||||
/* undo */
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Mask All");
|
||||
undo_set_mask(sprite->getUndo(), sprite);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
src_layer = sprite->getCurrentLayer();
|
||||
dst_layer = sprite->getCurrentLayer()->get_prev();
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Merge Down Layer");
|
||||
undo_open(sprite->getUndo());
|
||||
}
|
||||
@ -112,7 +112,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
|
||||
/* adding it in the stock of images */
|
||||
index = stock_add_image(sprite->getStock(), dst_image);
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_image(sprite->getUndo(), sprite->getStock(), index);
|
||||
|
||||
/* creating a copy of the cell */
|
||||
@ -120,7 +120,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
cel_set_position(dst_cel, src_cel->x, src_cel->y);
|
||||
cel_set_opacity(dst_cel, src_cel->opacity);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_cel(sprite->getUndo(), dst_layer, dst_cel);
|
||||
|
||||
static_cast<LayerImage*>(dst_layer)->addCel(dst_cel);
|
||||
@ -159,14 +159,14 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
src_cel->opacity,
|
||||
static_cast<LayerImage*>(src_layer)->get_blend_mode());
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_int(sprite->getUndo(), (GfxObj *)dst_cel, &dst_cel->x);
|
||||
undo_int(sprite->getUndo(), (GfxObj *)dst_cel, &dst_cel->y);
|
||||
}
|
||||
|
||||
cel_set_position(dst_cel, x1, y1);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_replace_image(sprite->getUndo(), sprite->getStock(), dst_cel->image);
|
||||
stock_replace_image(sprite->getStock(), dst_cel->image, new_image);
|
||||
|
||||
@ -175,7 +175,7 @@ void MergeDownLayerCommand::onExecute(Context* context)
|
||||
}
|
||||
}
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_layer(sprite->getUndo(), sprite);
|
||||
undo_remove_layer(sprite->getUndo(), src_layer);
|
||||
undo_close(sprite->getUndo());
|
||||
|
@ -509,7 +509,7 @@ static void sort_command(JWidget widget)
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TODO The following code is unreadable, move this to Undoable class
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Sort Palette");
|
||||
undo_open(sprite->getUndo());
|
||||
|
||||
@ -524,7 +524,7 @@ static void sort_command(JWidget widget)
|
||||
palette->setFrame(frame_begin);
|
||||
sprite->setPalette(palette, true);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
// Add undo information about the new added palette
|
||||
undo_add_palette(sprite->getUndo(), sprite, sprite->getPalette(frame_begin));
|
||||
|
||||
|
@ -63,7 +63,7 @@ void ReselectMaskCommand::onExecute(Context* context)
|
||||
mask = sprite->requestMask("*deselected*");
|
||||
|
||||
/* undo */
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Mask Reselection");
|
||||
undo_set_mask(sprite->getUndo(), sprite);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ void dialogs_mask_color(Sprite* sprite)
|
||||
Mask *mask;
|
||||
|
||||
/* undo */
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Mask by Color");
|
||||
undo_set_mask(sprite->getUndo(), sprite);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void dialogs_vector_map(Sprite* sprite)
|
||||
return;
|
||||
|
||||
/* undo stuff */
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_image(sprite->getUndo(), image, 0, 0, image->w, image->h);
|
||||
|
||||
dmax = std::sqrt(static_cast<double>(image->w/2*image->w/2 + image->h/2*image->h/2));
|
||||
|
@ -249,7 +249,7 @@ void effect_apply(Effect* effect)
|
||||
|
||||
if (!cancelled) {
|
||||
// Undo stuff
|
||||
if (undo_is_enabled(effect->sprite->getUndo())) {
|
||||
if (effect->sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(effect->sprite->getUndo(),
|
||||
effect->effect_data->label);
|
||||
undo_image(effect->sprite->getUndo(), effect->src,
|
||||
@ -309,7 +309,7 @@ void effect_apply_to_target(Effect *effect)
|
||||
|
||||
/* open undo group of operations */
|
||||
if (nimages > 1) {
|
||||
if (undo_is_enabled(effect->sprite->getUndo()))
|
||||
if (effect->sprite->getUndo()->isEnabled())
|
||||
undo_open(effect->sprite->getUndo());
|
||||
}
|
||||
|
||||
@ -330,7 +330,7 @@ void effect_apply_to_target(Effect *effect)
|
||||
|
||||
/* close undo group of operations */
|
||||
if (nimages > 1) {
|
||||
if (undo_is_enabled(effect->sprite->getUndo()))
|
||||
if (effect->sprite->getUndo()->isEnabled())
|
||||
undo_close(effect->sprite->getUndo());
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ LayerImage::LayerImage(const LayerImage* src_layer, Sprite* dst_sprite)
|
||||
Image* image_copy = image_new_copy(image);
|
||||
|
||||
cel_copy->image = stock_add_image(dst_sprite->getStock(), image_copy);
|
||||
if (undo_is_enabled(dst_sprite->getUndo()))
|
||||
if (dst_sprite->getUndo()->isEnabled())
|
||||
undo_add_image(dst_sprite->getUndo(), dst_sprite->getStock(), cel_copy->image);
|
||||
|
||||
addCel(cel_copy);
|
||||
|
@ -463,7 +463,7 @@ SpriteImpl::SpriteImpl(Sprite* sprite, int imgtype, int width, int height, int n
|
||||
m_layer = NULL;
|
||||
m_path = NULL;
|
||||
m_mask = mask_new();
|
||||
m_undo = undo_new(m_self);
|
||||
m_undo = new Undo(m_self);
|
||||
m_repository.paths = jlist_new();
|
||||
m_repository.masks = jlist_new();
|
||||
m_extraCel = NULL;
|
||||
@ -594,9 +594,10 @@ SpriteImpl* SpriteImpl::copyLayers(SpriteImpl* dst_sprite, const SpriteImpl* src
|
||||
|
||||
ASSERT(src_sprite->getFolder() != NULL);
|
||||
|
||||
undo_disable(dst_sprite->getUndo());
|
||||
// Disable undo temporarily
|
||||
dst_sprite->getUndo()->setEnabled(false);
|
||||
dst_sprite->m_folder = src_sprite->getFolder()->duplicate_for(dst_sprite->m_self);
|
||||
undo_enable(dst_sprite->getUndo());
|
||||
dst_sprite->getUndo()->setEnabled(true);
|
||||
|
||||
if (dst_sprite->m_folder == NULL) {
|
||||
delete dst_sprite;
|
||||
|
@ -304,19 +304,18 @@ Undo::~Undo()
|
||||
undo_stream_free(this->redo_stream);
|
||||
}
|
||||
|
||||
bool Undo::isEnabled() const
|
||||
{
|
||||
return this->enabled ? true: false;
|
||||
}
|
||||
|
||||
void Undo::setEnabled(bool state)
|
||||
{
|
||||
this->enabled = state;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/* General undo routines */
|
||||
|
||||
Undo* undo_new(Sprite *sprite)
|
||||
{
|
||||
return new Undo(sprite);
|
||||
}
|
||||
|
||||
void undo_free(Undo* undo)
|
||||
{
|
||||
ASSERT(undo);
|
||||
delete undo;
|
||||
}
|
||||
// General undo routines
|
||||
|
||||
int undo_get_memsize(const Undo* undo)
|
||||
{
|
||||
@ -326,30 +325,6 @@ int undo_get_memsize(const Undo* undo)
|
||||
undo->redo_stream->size;
|
||||
}
|
||||
|
||||
void undo_enable(Undo* undo)
|
||||
{
|
||||
ASSERT(undo);
|
||||
undo->enabled = true;
|
||||
}
|
||||
|
||||
void undo_disable(Undo* undo)
|
||||
{
|
||||
ASSERT(undo);
|
||||
undo->enabled = false;
|
||||
}
|
||||
|
||||
bool undo_is_enabled(const Undo* undo)
|
||||
{
|
||||
ASSERT(undo);
|
||||
return undo->enabled ? true: false;
|
||||
}
|
||||
|
||||
bool undo_is_disabled(const Undo* undo)
|
||||
{
|
||||
ASSERT(undo);
|
||||
return !undo_is_enabled(undo);
|
||||
}
|
||||
|
||||
bool undo_can_undo(const Undo* undo)
|
||||
{
|
||||
ASSERT(undo);
|
||||
|
@ -57,19 +57,13 @@ public:
|
||||
Undo(Sprite* sprite);
|
||||
virtual ~Undo();
|
||||
|
||||
bool isEnabled() const;
|
||||
void setEnabled(bool state);
|
||||
|
||||
};
|
||||
|
||||
Undo* undo_new(Sprite* sprite);
|
||||
void undo_free(Undo* undo);
|
||||
|
||||
int undo_get_memsize(const Undo* undo);
|
||||
|
||||
void undo_enable(Undo* undo);
|
||||
void undo_disable(Undo* undo);
|
||||
|
||||
bool undo_is_enabled(const Undo* undo);
|
||||
bool undo_is_disabled(const Undo* undo);
|
||||
|
||||
bool undo_can_undo(const Undo* undo);
|
||||
bool undo_can_redo(const Undo* undo);
|
||||
|
||||
|
@ -257,7 +257,7 @@ public:
|
||||
m_modify_selection = state;
|
||||
|
||||
if (state) {
|
||||
if (undo_is_enabled(loop->getSprite()->getUndo()))
|
||||
if (loop->getSprite()->getUndo()->isEnabled())
|
||||
undo_set_mask(loop->getSprite()->getUndo(), loop->getSprite());
|
||||
|
||||
loop->getMask()->freeze();
|
||||
|
@ -48,7 +48,7 @@ Undoable::Undoable(SpriteWriter& sprite, const char* label)
|
||||
|
||||
m_sprite = sprite;
|
||||
m_committed = false;
|
||||
m_enabledFlag = undo_is_enabled(m_sprite->getUndo());
|
||||
m_enabledFlag = m_sprite->getUndo()->isEnabled();
|
||||
|
||||
if (isEnabled()) {
|
||||
undo_set_label(m_sprite->getUndo(), label);
|
||||
@ -1075,7 +1075,7 @@ void Undoable::deselectMask()
|
||||
mask_set_name(mask, "*deselected*");
|
||||
m_sprite->addMask(mask);
|
||||
|
||||
if (undo_is_enabled(m_sprite->getUndo()))
|
||||
if (isEnabled())
|
||||
undo_set_mask(m_sprite->getUndo(), m_sprite);
|
||||
|
||||
/// Deselect the mask
|
||||
|
@ -69,7 +69,7 @@ void move_cel(SpriteWriter& sprite)
|
||||
src_cel = static_cast<LayerImage*>(src_layer)->getCel(src_frame);
|
||||
dst_cel = static_cast<LayerImage*>(dst_layer)->getCel(dst_frame);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Move Cel");
|
||||
undo_open(sprite->getUndo());
|
||||
|
||||
@ -88,14 +88,14 @@ void move_cel(SpriteWriter& sprite)
|
||||
/* move the cel in the same layer */
|
||||
if (src_cel != NULL) {
|
||||
if (src_layer == dst_layer) {
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_int(sprite->getUndo(), (GfxObj *)src_cel, &src_cel->frame);
|
||||
|
||||
src_cel->frame = dst_frame;
|
||||
}
|
||||
/* move the cel in different layers */
|
||||
else {
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_remove_cel(sprite->getUndo(), src_layer, src_cel);
|
||||
static_cast<LayerImage*>(src_layer)->removeCel(src_cel);
|
||||
|
||||
@ -113,7 +113,7 @@ void move_cel(SpriteWriter& sprite)
|
||||
sprite->getWidth(),
|
||||
sprite->getHeight(), 0);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_replace_image(sprite->getUndo(), sprite->getStock(), src_cel->image);
|
||||
undo_int(sprite->getUndo(), (GfxObj *)src_cel, &src_cel->x);
|
||||
undo_int(sprite->getUndo(), (GfxObj *)src_cel, &src_cel->y);
|
||||
@ -131,14 +131,14 @@ void move_cel(SpriteWriter& sprite)
|
||||
image_free(src_image);
|
||||
}
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_cel(sprite->getUndo(), dst_layer, src_cel);
|
||||
|
||||
static_cast<LayerImage*>(dst_layer)->addCel(src_cel);
|
||||
}
|
||||
}
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_close(sprite->getUndo());
|
||||
|
||||
set_frame_to_handle(NULL, 0, NULL, 0);
|
||||
@ -156,7 +156,7 @@ void copy_cel(SpriteWriter& sprite)
|
||||
src_cel = static_cast<LayerImage*>(src_layer)->getCel(src_frame);
|
||||
dst_cel = static_cast<LayerImage*>(dst_layer)->getCel(dst_frame);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Move Cel");
|
||||
undo_open(sprite->getUndo());
|
||||
|
||||
@ -208,7 +208,7 @@ void copy_cel(SpriteWriter& sprite)
|
||||
|
||||
/* add the image in the stock */
|
||||
image_index = stock_add_image(sprite->getStock(), dst_image);
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_image(sprite->getUndo(), sprite->getStock(), image_index);
|
||||
|
||||
/* create the new cel */
|
||||
@ -216,13 +216,13 @@ void copy_cel(SpriteWriter& sprite)
|
||||
cel_set_position(dst_cel, dst_cel_x, dst_cel_y);
|
||||
cel_set_opacity(dst_cel, dst_cel_opacity);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_cel(sprite->getUndo(), dst_layer, dst_cel);
|
||||
|
||||
static_cast<LayerImage*>(dst_layer)->addCel(dst_cel);
|
||||
}
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_close(sprite->getUndo());
|
||||
|
||||
set_frame_to_handle(NULL, 0, NULL, 0);
|
||||
@ -247,7 +247,7 @@ static void remove_cel(Sprite* sprite, LayerImage *layer, Cel *cel)
|
||||
}
|
||||
}
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_open(sprite->getUndo());
|
||||
|
||||
if (!used) {
|
||||
@ -255,14 +255,14 @@ static void remove_cel(Sprite* sprite, LayerImage *layer, Cel *cel)
|
||||
image from the stock */
|
||||
image = stock_get_image(sprite->getStock(), cel->image);
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_remove_image(sprite->getUndo(), sprite->getStock(), cel->image);
|
||||
|
||||
stock_remove_image(sprite->getStock(), image);
|
||||
image_free(image);
|
||||
}
|
||||
|
||||
if (undo_is_enabled(sprite->getUndo())) {
|
||||
if (sprite->getUndo()->isEnabled()) {
|
||||
undo_remove_cel(sprite->getUndo(), layer, cel);
|
||||
undo_close(sprite->getUndo());
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ void clipboard::paste(SpriteWriter& sprite)
|
||||
|
||||
// Add the new image in the stock
|
||||
int dst_image_index = stock_add_image(sprite->getStock(), dst_image);
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_add_image(sprite->getUndo(), sprite->getStock(), dst_image_index);
|
||||
|
||||
// Create the new cel in the current frame with the recently
|
||||
@ -284,7 +284,7 @@ void clipboard::paste(SpriteWriter& sprite)
|
||||
|
||||
if (w >= 1 && h >= 1) {
|
||||
/* undo region */
|
||||
if (undo_is_enabled(sprite->getUndo()))
|
||||
if (sprite->getUndo()->isEnabled())
|
||||
undo_image(sprite->getUndo(), dst_image, u1, v1, w, h);
|
||||
|
||||
/* draw the transformed image */
|
||||
|
@ -152,7 +152,7 @@ int interactive_move_layer(int mode, bool use_undo, int (*callback)())
|
||||
|
||||
/* the position was changed */
|
||||
if (!editor->editor_click_cancel()) {
|
||||
if (use_undo && undo_is_enabled(sprite->getUndo())) {
|
||||
if (use_undo && sprite->getUndo()->isEnabled()) {
|
||||
undo_set_label(sprite->getUndo(), "Cel Movement");
|
||||
undo_open(sprite->getUndo());
|
||||
undo_int(sprite->getUndo(), (GfxObj *)cel, &cel->x);
|
||||
|
@ -1901,7 +1901,7 @@ public:
|
||||
m_offset.y = -y1;
|
||||
|
||||
// Set undo label for any kind of undo used in the whole loop
|
||||
if (undo_is_enabled(m_sprite->getUndo()))
|
||||
if (m_sprite->getUndo()->isEnabled())
|
||||
undo_set_label(m_sprite->getUndo(), m_tool->getText().c_str());
|
||||
}
|
||||
|
||||
@ -1927,7 +1927,7 @@ public:
|
||||
m_cel->image = stock_add_image(m_sprite->getStock(), m_cel_image);
|
||||
|
||||
/* is the undo enabled? */
|
||||
if (undo_is_enabled(m_sprite->getUndo())) {
|
||||
if (m_sprite->getUndo()->isEnabled()) {
|
||||
/* we can temporary remove the cel */
|
||||
static_cast<LayerImage*>(m_sprite->getCurrentLayer())->removeCel(m_cel);
|
||||
|
||||
@ -1944,7 +1944,7 @@ public:
|
||||
}
|
||||
else {
|
||||
/* undo the dirty region */
|
||||
if (undo_is_enabled(m_sprite->getUndo())) {
|
||||
if (m_sprite->getUndo()->isEnabled()) {
|
||||
Dirty* dirty = dirty_new_from_differences(m_cel_image,
|
||||
m_dst_image);
|
||||
// TODO error handling
|
||||
@ -1963,7 +1963,7 @@ public:
|
||||
/* if the size of both images are different, we have to replace
|
||||
the entire image */
|
||||
else {
|
||||
if (undo_is_enabled(m_sprite->getUndo())) {
|
||||
if (m_sprite->getUndo()->isEnabled()) {
|
||||
undo_open(m_sprite->getUndo());
|
||||
|
||||
if (m_cel->x != m_old_cel_x) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user