Make moving a marker undoable

This commit is contained in:
Thomas Wilshaw
2021-10-22 22:15:56 +01:00
parent d04d165451
commit c8552ad184
5 changed files with 50 additions and 1 deletions
+23
View File
@@ -112,4 +112,27 @@ void MarkerChangeNameCommand::undo()
marker_->set_name(old_name_);
}
MarkerChangeTimeCommand::MarkerChangeTimeCommand(Project* project, TimelineMarker* marker, TimeRange time) :
project_(project),
marker_(marker),
old_time_(marker->time()),
new_time_(time)
{
}
Project* MarkerChangeTimeCommand::GetRelevantProject() const
{
return project_;
}
void MarkerChangeTimeCommand::redo()
{
marker_->set_time(new_time_);
}
void MarkerChangeTimeCommand::undo()
{
marker_->set_time(old_time_);
}
}