Permalink
Browse files

Merge pull request #761 from CandyFace/undo-feature

Implemented UNDO frame deletion for Bitmap, Vector and Sound
  • Loading branch information...
chchwy committed Sep 22, 2017
2 parents ecd5d2b + 121497c commit e031656a199f6079697abed3387cc2e17368e54a
Showing with 260 additions and 103 deletions.
  1. +1 −0 app/actioncommands.cpp
  2. +15 −3 core_lib/interface/backupelement.h
  3. +242 −100 core_lib/interface/editor.cpp
  4. +2 −0 core_lib/interface/editor.h
View
@@ -299,6 +299,7 @@ void ActionCommands::removeKey()
{
case Layer::BITMAP:
case Layer::VECTOR:
case Layer::SOUND:
case Layer::CAMERA:
layer->addNewEmptyKeyAt( 1 );
break;
@@ -21,15 +21,15 @@ GNU General Public License for more details.
#include <QObject>
#include "vectorimage.h"
#include "bitmapimage.h"
#include "soundclip.h"
class Editor;
class BackupElement : public QObject
{
Q_OBJECT
public:
enum types { UNDEFINED, BITMAP_MODIF, VECTOR_MODIF };
enum types { UNDEFINED, BITMAP_MODIF, VECTOR_MODIF, SOUND_MODIF };
QString undoText;
bool somethingSelected;
@@ -47,7 +47,6 @@ class BackupBitmapElement : public BackupElement
int layer, frame;
BitmapImage bitmapImage;
//BackupBitmapElement() { type = BackupElement::BITMAP_MODIF; }
int type() { return BackupElement::BITMAP_MODIF; }
void restore(Editor*);
};
@@ -64,4 +63,17 @@ class BackupVectorElement : public BackupElement
void restore(Editor*);
};
class BackupSoundElement : public BackupElement
{
Q_OBJECT
public:
BackupSoundElement(SoundClip* sound) { clip = *sound; }
int layer, frame;
SoundClip clip;
QString fileName;
int type() { return BackupElement::SOUND_MODIF; }
void restore( Editor* );
};
#endif // BACKUPELEMENT_H
Oops, something went wrong.

0 comments on commit e031656

Please sign in to comment.