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 }