mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-14 05:06:54 +03:00
UITextSpan drawBorder fix when span has padding.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <eepp/graphics/text.hpp>
|
||||
#include <eepp/ui/css/propertydefinition.hpp>
|
||||
#include <eepp/ui/tools/htmlformatter.hpp>
|
||||
#include <eepp/ui/uiborderdrawable.hpp>
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
#include <eepp/ui/uitextspan.hpp>
|
||||
#include <eepp/ui/uithememanager.hpp>
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user