fixed disabling keyframe bug

This commit is contained in:
itsmattkc
2019-01-05 14:29:21 +11:00
parent 4cc97d607f
commit 90181ea9c5
4 changed files with 24 additions and 4 deletions
+1
View File
@@ -68,6 +68,7 @@ void EffectRow::set_keyframe_enabled(bool enabled) {
ca->append(new KeyframeDelete(f, 0));
}
}
ca->append(new SetKeyframing(this, false));
undo_stack.push(ca);
panel_effect_controls->update_keyframes();
} else {
+13
View File
@@ -1291,3 +1291,16 @@ void KeyframeFieldSet::redo() {
}
done = true;
}
SetKeyframing::SetKeyframing(EffectRow *irow, bool ib) :
row(irow),
b(ib)
{}
void SetKeyframing::undo() {
row->setKeyframing(!b);
}
void SetKeyframing::redo() {
row->setKeyframing(b);
}
+10
View File
@@ -641,4 +641,14 @@ private:
QVariant new_val;
};
class SetKeyframing : public QUndoCommand {
public:
SetKeyframing(EffectRow* irow, bool ib);
void undo();
void redo();
private:
EffectRow* row;
bool b;
};
#endif // UNDO_H