fix: bugs surfaced by new gtest coverage

- html.cpp: rgba() colors parsed with setRedF/GreenF/BlueF (0-1) while the
  writer emits 0-255 integers, so semi-transparent text colors lost their
  RGB on round-trip; parse with integer setters instead
- CLIProgressDialog: percentage padding compared normalized progress
  (0.0-1.0) against 10/100, so padding was always fully applied; compute
  the percentage first
- TimelineUndoPointer BlockTrimCommand: remove_block_from_graph_ was
  never initialized (UB on redo)
- TimelineUndoGeneral TransitionRemoveCommand: track_ was never
  initialized; GetRelevantProject() could dereference it before redo()
- ProjectLoadTask::Run(): failure path deleted project_ without
  resetting it, leaving GetLoadedProject() dangling
This commit is contained in:
2026-07-17 13:07:43 +08:00
parent a9afb2fac5
commit dd7427f51a
5 changed files with 15 additions and 6 deletions
+8 -3
View File
@@ -86,15 +86,20 @@ void CLIProgressDialog::Update()
std::cout << "] ";
if (progress_ < 100) {
// Pad the percentage so single/double/triple digit values all occupy the
// same width. Note progress_ is normalized (0.0-1.0), so the percentage
// must be computed before comparing against 10/100.
const int percent = qRound(progress_ * 100.0);
if (percent < 100) {
std::cout << " ";
}
if (progress_ < 10) {
if (percent < 10) {
std::cout << " ";
}
std::cout << qRound(progress_ * 100.0) << "% " << std::endl << std::flush;
std::cout << percent << "% " << std::endl << std::flush;
}
void CLIProgressDialog::SetProgress(double p)