Skip to content

Commit

Permalink
Merge branch 'misc' into feature
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Feb 8, 2024
2 parents e67fe10 + eaf09b2 commit ba9f48a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/base_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ void BaseGrid::OnSubtitlesCommit(int type) {
if (type == AssFile::COMMIT_NEW || type & AssFile::COMMIT_ORDER || type & AssFile::COMMIT_DIAG_ADDREM || type & AssFile::COMMIT_FOLD)
UpdateMaps();

if (type & AssFile::COMMIT_DIAG_META) {
if (type & AssFile::COMMIT_DIAG_META || type & AssFile::COMMIT_DIAG_TIME) {
SetColumnWidths();
Refresh(false);
return;
}
if (type & AssFile::COMMIT_DIAG_TIME)
Refresh(false);
else if (type & AssFile::COMMIT_DIAG_TEXT) {
} else if (type & AssFile::COMMIT_DIAG_TEXT) {
for (auto const& rect : text_refresh_rects)
RefreshRect(rect, false);
}
Expand Down
12 changes: 6 additions & 6 deletions src/grid_column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ struct GridColumnStartTime final : GridColumnTime {
}

int Width(const agi::Context *c, WidthHelper &helper) const override {
agi::Time max_time = max_value(&AssDialogue::Start, c->ass->Events);
if (!by_frame)
return helper(wxS("0:00:00.00"));
int frame = c->videoController->FrameAtTime(max_value(&AssDialogue::Start, c->ass->Events), agi::vfr::START);
return helper(std::to_wstring(frame));
return helper(max_time.GetAssFormatted());
return helper(std::to_wstring(c->videoController->FrameAtTime(max_time, agi::vfr::START)));
}
};

Expand All @@ -222,10 +222,10 @@ struct GridColumnEndTime final : GridColumnTime {
}

int Width(const agi::Context *c, WidthHelper &helper) const override {
agi::Time max_time = max_value(&AssDialogue::End, c->ass->Events);
if (!by_frame)
return helper(wxS("0:00:00.00"));
int frame = c->videoController->FrameAtTime(max_value(&AssDialogue::End, c->ass->Events), agi::vfr::END);
return helper(std::to_wstring(frame));
return helper(max_time.GetAssFormatted());
return helper(std::to_wstring(c->videoController->FrameAtTime(max_time, agi::vfr::END)));
}
};

Expand Down

0 comments on commit ba9f48a

Please sign in to comment.