MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / RemoveSelection

Method RemoveSelection

src/visual_tool.cpp:304–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302
303template<class FeatureType>
304void VisualTool<FeatureType>::RemoveSelection(FeatureType *feat) {
305 if (!sel_features.erase(feat) || !feat->line) return;
306 for (auto sel : sel_features)
307 if (sel->line == feat->line) return;
308
309 auto sel = c->selectionController->GetSelectedSet();
310
311 // Don't deselect the only selected line
312 if (sel.size() <= 1) return;
313
314 sel.erase(feat->line);
315
316 // Set the active line to an arbitrary selected line if we just
317 // deselected the active line
318 AssDialogue *new_active = c->selectionController->GetActiveLine();
319 if (feat->line == new_active)
320 new_active = *sel.begin();
321
322 c->selectionController->SetSelectionAndActive(std::move(sel), new_active);
323}
324
325//////// PARSERS
326

Callers

nothing calls this directly

Calls 5

eraseMethod · 0.80
GetActiveLineMethod · 0.80
SetSelectionAndActiveMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected