mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Fix line-height.
This commit is contained in:
@@ -551,9 +551,8 @@ void RichText::updateLayout() {
|
||||
|
||||
Float ascent = fontStyle.Font->getAscent( fontStyle.CharacterSize );
|
||||
Float height =
|
||||
pText->lineHeight > 0 ? pText->lineHeight
|
||||
: mLineHeight > 0
|
||||
? mLineHeight
|
||||
pText->lineHeight > 0
|
||||
? pText->lineHeight
|
||||
: fontStyle.Font->getLineSpacing( fontStyle.CharacterSize );
|
||||
Float spanWidth = renderSpanText->getTextWidth();
|
||||
|
||||
@@ -844,9 +843,8 @@ void RichText::updateLayout() {
|
||||
renderSpanText->setStyleConfig( fontStyle );
|
||||
|
||||
Float ascent = fontStyle.Font->getAscent( fontStyle.CharacterSize );
|
||||
Float height = pText->lineHeight > 0 ? pText->lineHeight
|
||||
: mLineHeight > 0
|
||||
? mLineHeight
|
||||
Float height = pText->lineHeight > 0
|
||||
? pText->lineHeight
|
||||
: fontStyle.Font->getLineSpacing( fontStyle.CharacterSize );
|
||||
Float spanWidth = renderSpanText->getTextWidth();
|
||||
|
||||
|
||||
@@ -170,6 +170,14 @@ UTEST( UIRichText, anchorMargins ) {
|
||||
SceneManager::instance()->draw();
|
||||
win->display();
|
||||
|
||||
auto anchors = sceneNode->getRoot()->findAllByTag( "a" );
|
||||
|
||||
for ( auto anchor : anchors ) {
|
||||
auto a = anchor->asType<UIAnchorSpan>();
|
||||
EXPECT_EQ( anchor->getPixelsSize().getHeight(),
|
||||
a->getFont()->getLineSpacing( a->getFontSize() ) );
|
||||
}
|
||||
|
||||
compareImages( utest_state, utest_result, win, "eepp-ui-anchor-margins", "html" );
|
||||
|
||||
Engine::destroySingleton();
|
||||
|
||||
Reference in New Issue
Block a user