Don't try to shift to a negative start time when shifting lines to frame zero

Originally committed to SVN as r6951.
This commit is contained in:
Thomas Goyne 2012-07-29 03:23:27 +00:00
parent ffe41cdf20
commit e2e304f2cb
1 changed files with 2 additions and 1 deletions

View File

@ -136,7 +136,8 @@ struct time_frame_current : public validate_video_loaded {
if (sel.empty() || !active_line) return;
int shift_by = c->videoController->TimeAtFrame(c->videoController->GetFrameN(), agi::vfr::START) - active_line->Start;
int target_start = std::max(0, c->videoController->TimeAtFrame(c->videoController->GetFrameN(), agi::vfr::START));
int shift_by = target_start - active_line->Start;
for (std::set<AssDialogue*>::iterator it = sel.begin(); it != sel.end(); ++it) {
(*it)->Start = (*it)->Start + shift_by;