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

Method SetColumnWidths

src/base_grid.cpp:594–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592}
593
594void BaseGrid::SetColumnWidths() {
595 int w, h;
596 GetClientSize(&w, &h);
597
598 // DC for text extents test
599 wxClientDC dc(this);
600 dc.SetFont(font);
601
602 text_refresh_rects.clear();
603 int x = 0;
604
605 if (!width_helper)
606 width_helper = std::make_unique<WidthHelper>();
607 width_helper->SetDC(&dc);
608
609 for (auto const& column : columns) {
610 column->UpdateWidth(context, *width_helper);
611 if (column->Width() && column->RefreshOnTextChange())
612 text_refresh_rects.emplace_back(x, 0, column->Width(), h);
613 x += column->Width();
614 }
615 width_helper->Age();
616}
617
618AssDialogue *BaseGrid::GetDialogue(int n) const {
619 if (static_cast<size_t>(n) >= index_line_map.size()) return nullptr;

Callers

nothing calls this directly

Calls 7

SetFontMethod · 0.80
SetDCMethod · 0.80
UpdateWidthMethod · 0.80
clearMethod · 0.45
WidthMethod · 0.45
RefreshOnTextChangeMethod · 0.45
AgeMethod · 0.45

Tested by

no test coverage detected