diff --git a/aegisub/src/base_grid.cpp b/aegisub/src/base_grid.cpp index 882b84423..6d6453e72 100644 --- a/aegisub/src/base_grid.cpp +++ b/aegisub/src/base_grid.cpp @@ -324,25 +324,6 @@ void BaseGrid::SelectRow(int row, bool addToSelected, bool select) { RefreshRect(wxRect(0, (row + 1 - yPos) * lineHeight, w, lineHeight), false); } -void BaseGrid::SelectVisible() { - Selection new_selection; - - int rows = GetRows(); - bool selectedOne = false; - for (int i=0;ivideoController->IsLoaded()) return; c->videoController->Stop(); - c->subsGrid->SelectVisible(); + + SubtitleSelectionController::Selection new_selection; + int frame = c->videoController->GetFrameN(); + + for (entryIter it = c->ass->Line.begin(); it != c->ass->Line.end(); ++it) { + AssDialogue *diag = dynamic_cast(*it); + if (diag && + c->videoController->FrameAtTime(diag->Start.GetMS(), agi::vfr::START) <= frame && + c->videoController->FrameAtTime(diag->End.GetMS(), agi::vfr::END) >= frame) + { + if (new_selection.empty()) + c->selectionController->SetActiveLine(diag); + new_selection.insert(diag); + } + } + + c->selectionController->SetSelectedSet(new_selection); } bool Validate(agi::Context *c) {