From 4f7f4f7099eb732a8282e4cf998427c906f47b04 Mon Sep 17 00:00:00 2001 From: Daniel Stevens Date: Fri, 21 Feb 2025 16:56:24 -0700 Subject: [PATCH] Set `title` once when the `structure` is set There's really no need to update the `title` every frame. --- appOPHD/UI/StructureInspector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appOPHD/UI/StructureInspector.cpp b/appOPHD/UI/StructureInspector.cpp index 2bbcfe594..70cf9866a 100644 --- a/appOPHD/UI/StructureInspector.cpp +++ b/appOPHD/UI/StructureInspector.cpp @@ -155,6 +155,8 @@ void StructureInspector::structure(Structure* structure) if (!mStructure) { return; } + title(mStructure->name()); + auto stringTable = buildGenericStringTable(); auto windowWidth = stringTable.screenRect().size.x + 10; @@ -199,7 +201,6 @@ void StructureInspector::update() { throw std::runtime_error("Null pointer to structure within StructureInspector"); } - title(mStructure->name()); const auto genericStructureAttributes = buildGenericStringTable(); const auto specificAttributeTablePosition = genericStructureAttributes.screenRect().crossYPoint() + NAS2D::Vector{0, 25};