Skip to content

Commit

Permalink
xrUICore/Static/UIStatic.cpp: constify variables
Browse files Browse the repository at this point in the history
Removed excess scope
  • Loading branch information
Xottab-DUTY committed Feb 9, 2024
1 parent a66a0de commit 62b347d
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/xrUICore/Static/UIStatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ void CUIStatic::DrawTexture()
{
if (m_UIStaticItem.GetFixedLTWhileHeading())
{
float t1, t2;
t1 = rect.width();
t2 = rect.height();
const float t1 = rect.width();
const float t2 = rect.height();
rect.y2 = rect.y1 + t1;
rect.x2 = rect.x1 + t2;
}
Expand All @@ -117,20 +116,17 @@ void CUIStatic::DrawTexture()
}
else
{
Frect r = {0.0f, 0.0f, m_UIStaticItem.GetTextureRect().width(), m_UIStaticItem.GetTextureRect().height()};
const Frect r = { 0.0f, 0.0f, m_UIStaticItem.GetTextureRect().width(), m_UIStaticItem.GetTextureRect().height() };

if (Heading())
{
if (Heading())
{
float t1, t2;
t1 = rect.width();
t2 = rect.height();
rect.y2 = rect.y1 + t1;
rect.x2 = rect.x1 + t2;
}

m_UIStaticItem.SetSize(Fvector2().set(r.width(), r.height()));
const float t1 = rect.width();
const float t2 = rect.height();
rect.y2 = rect.y1 + t1;
rect.x2 = rect.x1 + t2;
}

m_UIStaticItem.SetSize(Fvector2().set(r.width(), r.height()));
}

if (Heading())
Expand Down

0 comments on commit 62b347d

Please sign in to comment.