mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Don't check all scrollbars' visibility in CText
The CText class is designed to only work with one scrollbar, so the any_of was pointless.
This commit is contained in:
parent
a784659158
commit
6ed963b94c
1 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ void CText::SetupText()
|
||||||
GetScrollBar(0).SetPos(0.0f);
|
GetScrollBar(0).SetPos(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_ScrollBar || !std::ranges::any_of(m_ScrollBars, &IGUIScrollBar::IsVisible))
|
if (!m_ScrollBar || !GetScrollBar(0).IsVisible())
|
||||||
CalculateTextPosition(GetActualSize(), m_TextPos, m_GeneratedTexts[0]);
|
CalculateTextPosition(GetActualSize(), m_TextPos, m_GeneratedTexts[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ void CText::Draw(CCanvas2D& canvas)
|
||||||
|
|
||||||
const CGUIColor& color = m_Enabled ? m_TextColor : m_TextColorDisabled;
|
const CGUIColor& color = m_Enabled ? m_TextColor : m_TextColorDisabled;
|
||||||
|
|
||||||
if (m_ScrollBar && std::ranges::any_of(m_ScrollBars, &IGUIScrollBar::IsVisible))
|
if (m_ScrollBar && GetScrollBar(0).IsVisible())
|
||||||
{
|
{
|
||||||
DrawText(canvas, 0, color, GetActualSize().TopLeft() - CVector2D(0.f, scroll), cliparea);
|
DrawText(canvas, 0, color, GetActualSize().TopLeft() - CVector2D(0.f, scroll), cliparea);
|
||||||
// Draw scrollbars on top of the content
|
// Draw scrollbars on top of the content
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue