Skip to content

Commit

Permalink
Set title once when the structure is set
Browse files Browse the repository at this point in the history
There's really no need to update the `title` every frame.
  • Loading branch information
DanRStevens committed Feb 21, 2025
1 parent 5a60a69 commit 4f7f4f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion appOPHD/UI/StructureInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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};
Expand Down

0 comments on commit 4f7f4f7

Please sign in to comment.