Skip to content

Commit

Permalink
Empty string on fmt fail; no draw in that case.
Browse files Browse the repository at this point in the history
IDIOT.
  • Loading branch information
ceejbot committed Dec 7, 2023
1 parent 5f0340f commit 3201183
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/data/huditem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl HudItem {
Ok(v) => v,
Err(e) => {
log::trace!("Failed to render format string for HUD item; error: {e:#}");
fmt.clone()
"".to_string()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/ui_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ namespace ui
if (label.color.a == 0) { continue; }
const auto textPos = ImVec2(label.anchor.x, label.anchor.y);
auto entrytxt = std::string(entry->fmtstr(label.contents));
drawText(entrytxt, textPos, label.font_size, label.color, label.alignment);
if (!entrytxt.empty()) { drawText(entrytxt, textPos, label.font_size, label.color, label.alignment); }
}

// Draw the hotkey reminder if asked.
Expand Down

0 comments on commit 3201183

Please sign in to comment.