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
-4
View File
@@ -713,10 +713,6 @@ void GraphView::wheelEvent(QWheelEvent *event) {
double new_zoom = (event->angleDelta().y() < 0) ? zoom - zoom_diff : zoom + zoom_diff;
// center zoom on screen
/*set_scroll_x(qRound(x_scroll + double(event->pos().x())*new_zoom - double(event->pos().x())*zoom));
set_scroll_y(qRound(y_scroll + double(height()-event->pos().y())*new_zoom - double(height()-event->pos().y())*zoom));*/
/*set_scroll_x(qRound((double(x_scroll)/zoom*new_zoom) + (double(event->pos().x())/zoom*new_zoom)));
set_scroll_y(qRound((double(y_scroll)/zoom*new_zoom)));*/
set_scroll_x(qRound((double(x_scroll)/zoom*new_zoom) + double(event->pos().x())*new_zoom - double(event->pos().x())*zoom));
set_scroll_y(qRound((double(y_scroll)/zoom*new_zoom) + double(height()-event->pos().y())*new_zoom - double(height()-event->pos().y())*zoom));