[Gui] fix the FPS text visibilty issues raised in #19371 (#19385)

* [Gui] fix the FPS text visibilty issues
* [Gui] code efficiency based on suggestions
* [Gui] update color parameter
* [Gui] Fix Lint feedback
* [Gui] check if string is empty
This commit is contained in:
Syres916
2025-02-11 19:16:29 +00:00
committed by GitHub
parent afe122738f
commit 99eed953c3
4 changed files with 21 additions and 8 deletions

View File

@@ -2451,7 +2451,17 @@ void View3DInventorViewer::renderScene()
stream.precision(1);
stream.setf(std::ios::fixed | std::ios::showpoint);
stream << framesPerSecond[0] << " ms / " << framesPerSecond[1] << " fps";
draw2DString(stream.str().c_str(), SbVec2s(10, 10), SbVec2f(0.1F, 0.1F)); // NOLINT
ParameterGrp::handle hGrpOverlayL = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/MainWindow/DockWindows/OverlayLeft");
std::string overlayLeftWidgets = hGrpOverlayL->GetASCII("Widgets", "");
ParameterGrp::handle hGrpView = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/View");
unsigned long axisLetterColor =
hGrpView->GetUnsigned("AxisLetterColor", 4294902015); // default FPS color (yellow)
draw2DString(stream.str().c_str(),
SbVec2s(10, 10),
SbVec2f((overlayLeftWidgets.empty() ? 0.1f : 1.1f), 0.1f),
App::Color(static_cast<uint32_t>(axisLetterColor))); // NOLINT
}
if (naviCubeEnabled) {