fix: Performance Overlay menu width#1117
Conversation
WalkthroughA conditional block was added to the Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Menu.cpp (1)
1195-1200: LGTM! Effective solution for preventing overlay width fluctuations.The conditional logic correctly addresses the stated issue by setting a fixed width when graphs are disabled. The text scale multiplication ensures proper scaling across different font sizes, and the automatic height (0) allows for appropriate vertical sizing.
Consider extracting the magic number to improve maintainability:
+ static constexpr float OVERLAY_FIXED_WIDTH = 325.0f; + // Set window size based on whether graphs are shown, was rapidly changing size based on text bool hasGraphs = settings.PerfOverlay.ShowPreFGFrameTimeGraph || settings.PerfOverlay.ShowPostFGFrameTimeGraph; if (!hasGraphs) { - float fixedWidth = 325.0f * textScale; + float fixedWidth = OVERLAY_FIXED_WIDTH * textScale; ImGui::SetNextWindowSize(ImVec2(fixedWidth, 0), ImGuiCond_Always); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Menu.cpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build plugin and addons
|
✅ A pre-release build is available for this PR: |
Sets a fixed width for the perf overlay menu as it would rapidly change when graphs were disabled with the background enabled.
Summary by CodeRabbit