From 4fcf9797aae74438f9585dab494105fbdaa47230 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Fri, 7 Jun 2024 08:30:01 +0200 Subject: [PATCH] Fix supertip flicker; enable supertip border --- src/gui/guiHyperText.cpp | 9 ++++++--- src/gui/guiHyperText.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/guiHyperText.cpp b/src/gui/guiHyperText.cpp index 3be56bfa2..e00249b28 100644 --- a/src/gui/guiHyperText.cpp +++ b/src/gui/guiHyperText.cpp @@ -1121,7 +1121,7 @@ void GUIHyperText::setStyles(const std::array ParsedText &text = m_drawer.getText(); text.background_middle = style.getRect(StyleSpec::BGIMG_MIDDLE, core::rect()); - text.border = style.getBool(StyleSpec::BORDER, false); + text.border = style.getBool(StyleSpec::BORDER, true); setNotClipped(style.getBool(StyleSpec::NOCLIP, true)); if (text.background_type != text.BackgroundType::BACKGROUND_COLOR) { @@ -1236,8 +1236,11 @@ void GUIHyperText::draw() m_vscrollbar->setPos(0); m_vscrollbar->setVisible(false); } - m_drawer.draw(AbsoluteClippingRect, - m_display_text_rect.UpperLeftCorner + m_text_scrollpos); + if (m_drawer_ready) + m_drawer.draw(AbsoluteClippingRect, + m_display_text_rect.UpperLeftCorner + m_text_scrollpos); + else + m_drawer_ready = true; // draw children IGUIElement::draw(); diff --git a/src/gui/guiHyperText.h b/src/gui/guiHyperText.h index 46d96d450..475f64ea1 100644 --- a/src/gui/guiHyperText.h +++ b/src/gui/guiHyperText.h @@ -235,4 +235,6 @@ class GUIHyperText : public gui::IGUIElement ParsedText::Element *getElementAt(s32 X, s32 Y); void checkHover(s32 X, s32 Y); + + bool m_drawer_ready = false; };