Skip to content

Commit

Permalink
#98: ensure font size and window size are initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Aug 6, 2024
1 parent 24e5267 commit b9eab74
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vt-tv/utility/parse_render.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ void ParseRender::parseAndRender(PhaseType phase_id, std::unique_ptr<Info> info)
std::string output_dir;
std::filesystem::path output_path;
std::string output_file_stem;
uint64_t win_size;
uint64_t font_size;
uint64_t win_size = 2000;
// Use automatic font size if not defined by user
// 0.025 is the factor of the window size determined to be ideal for the font size
uint64_t font_size = 0.025 * win_size;

if (save_meshes || save_pngs) {
output_dir = config["output"]["directory"].as<std::string>();
Expand All @@ -151,14 +153,12 @@ void ParseRender::parseAndRender(PhaseType phase_id, std::unique_ptr<Info> info)

fmt::print("Num ranks={}\n", info->getNumRanks());

win_size = 2000;
if (config["output"]["window_size"]) {
win_size = config["output"]["window_size"].as<uint64_t>();
// Update font_size with new win_size
font_size = 0.025 * win_size;
}

// Use automatic font size if not defined by user
// 0.025 is the factor of the window size determined to be ideal for the font size
font_size = 0.025 * win_size;
if (config["output"]["font_size"]) {
font_size = config["output"]["font_size"].as<uint64_t>();
}
Expand Down

0 comments on commit b9eab74

Please sign in to comment.