From e2e304f2cbf2d8ef09c1ac74686cda63a5ae40b6 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 29 Jul 2012 03:23:27 +0000 Subject: [PATCH] Don't try to shift to a negative start time when shifting lines to frame zero Originally committed to SVN as r6951. --- aegisub/src/command/time.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aegisub/src/command/time.cpp b/aegisub/src/command/time.cpp index a8ad283cf..1fc432b65 100644 --- a/aegisub/src/command/time.cpp +++ b/aegisub/src/command/time.cpp @@ -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::iterator it = sel.begin(); it != sel.end(); ++it) { (*it)->Start = (*it)->Start + shift_by;