From bdc15cfdc5b2f50f803ef9a7d332c4c7cf83f101 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sat, 15 Feb 2025 15:44:41 +0100 Subject: [PATCH] fix scroll issue (#5076) --- client/widgets/MiscWidgets.cpp | 9 +++++++++ client/widgets/MiscWidgets.h | 1 + 2 files changed, 10 insertions(+) diff --git a/client/widgets/MiscWidgets.cpp b/client/widgets/MiscWidgets.cpp index c6e888571..192cceb38 100644 --- a/client/widgets/MiscWidgets.cpp +++ b/client/widgets/MiscWidgets.cpp @@ -550,6 +550,15 @@ CreatureTooltip::CreatureTooltip(Point pos, const CGCreature * creature) tooltipTextbox = std::make_shared(textContent, Rect(15, 95, 230, 150), 0, FONT_SMALL, ETextAlignment::TOPCENTER, Colors::WHITE); } +void CreatureTooltip::show(Canvas & to) +{ + // fixes scrolling of textbox (#5076) + setRedrawParent(true); + redraw(); + + CIntObject::show(to); +} + void MoraleLuckBox::set(const AFactionMember * node) { OBJECT_CONSTRUCTION; diff --git a/client/widgets/MiscWidgets.h b/client/widgets/MiscWidgets.h index 926d54f32..729466f02 100644 --- a/client/widgets/MiscWidgets.h +++ b/client/widgets/MiscWidgets.h @@ -166,6 +166,7 @@ class CreatureTooltip : public CIntObject std::shared_ptr creatureImage; std::shared_ptr tooltipTextbox; + void show(Canvas & to) override; public: CreatureTooltip(Point pos, const CGCreature * creature); };