mirror of https://github.com/odrling/Aegisub
Fix off-by-one error in the bounds check for restoring the active line
This commit is contained in:
parent
ec6f14eef4
commit
7b0b74fbb0
|
@ -35,7 +35,7 @@ void SelectionController::OnSubtitlesOpen() {
|
||||||
selection.clear();
|
selection.clear();
|
||||||
active_line = nullptr;
|
active_line = nullptr;
|
||||||
if (!context->ass->Events.empty()) {
|
if (!context->ass->Events.empty()) {
|
||||||
int row = mid<int>(0, context->ass->GetUIStateAsInt("Active Line"), context->ass->Events.size());
|
int row = mid<int>(0, context->ass->GetUIStateAsInt("Active Line"), context->ass->Events.size() - 1);
|
||||||
active_line = &*std::next(context->ass->Events.begin(), row);
|
active_line = &*std::next(context->ass->Events.begin(), row);
|
||||||
selection.insert(active_line);
|
selection.insert(active_line);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue