From c65122e120b481cec908fca9470888b6cf82d5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 28 Apr 2026 01:28:25 -0300 Subject: [PATCH] UITextSpan drawBorder fix when span has padding. --- include/eepp/ui/uitextspan.hpp | 2 ++ src/eepp/ui/uitextspan.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/eepp/ui/uitextspan.hpp b/include/eepp/ui/uitextspan.hpp index d690e9f05..03d22f1d7 100644 --- a/include/eepp/ui/uitextspan.hpp +++ b/include/eepp/ui/uitextspan.hpp @@ -142,6 +142,8 @@ class EE_API UITextSpan : public UIHTMLWidget { explicit UITextSpan( const std::string& tag = "span" ); + virtual void drawBorder(); + virtual void onTextChanged(); virtual void onFontChanged(); diff --git a/src/eepp/ui/uitextspan.cpp b/src/eepp/ui/uitextspan.cpp index 15df5f661..7a5aaac0f 100644 --- a/src/eepp/ui/uitextspan.cpp +++ b/src/eepp/ui/uitextspan.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,16 @@ bool UITextSpan::isType( const Uint32& type ) const { return UITextSpan::getType() == type ? true : UIWidget::isType( type ); } +void UITextSpan::drawBorder() { + if ( ( mFlags & UI_BORDER ) && NULL != mBorder ) { + mBorder->setAlpha( mAlpha ); + mBorder->draw( { std::trunc( mScreenPos.x - mPaddingPx.Left ), + std::trunc( mScreenPos.y - mPaddingPx.Top ) }, + { std::floor( mSize.x + mPaddingPx.Left + mPaddingPx.Right ), + std::floor( mSize.y + mPaddingPx.Top + mPaddingPx.Bottom ) } ); + } +} + void UITextSpan::draw() { // Skip native generic rendering because it will be drawn by UIRichText }