mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -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
3a7c9a15cd
commit
1db11c0df4
1 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ void CText::SetupText()
|
|||
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]);
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ void CText::Draw(CCanvas2D& canvas)
|
|||
|
||||
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);
|
||||
// Draw scrollbars on top of the content
|
||||
|
|
|
|||
Loading…
Reference in a new issue