fixed disabling keyframe bug
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user