mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CTextBox: consider utf8 mode parameter for correct render width, if required
This commit is contained in:
@@ -397,7 +397,7 @@ void CTextBox::refreshTextLineArray(void)
|
|||||||
aktWord = m_cText.substr(pos_prev, pos - pos_prev + 1);
|
aktWord = m_cText.substr(pos_prev, pos - pos_prev + 1);
|
||||||
|
|
||||||
//calculate length of current found word
|
//calculate length of current found word
|
||||||
aktWordWidth = m_pcFontText->getRenderWidth(aktWord);
|
aktWordWidth = m_pcFontText->getRenderWidth(aktWord, m_utf8_encoded);
|
||||||
|
|
||||||
//set next start pos
|
//set next start pos
|
||||||
pos_prev = pos + 1;
|
pos_prev = pos + 1;
|
||||||
@@ -640,10 +640,10 @@ void CTextBox::refreshText(void)
|
|||||||
{
|
{
|
||||||
//calculate centered xpos
|
//calculate centered xpos
|
||||||
if( m_nMode & CENTER ){
|
if( m_nMode & CENTER ){
|
||||||
x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i]))>>1) - text_Hborder_width;
|
x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i]))>>1, m_utf8_encoded) - text_Hborder_width;
|
||||||
}
|
}
|
||||||
else if ( m_nMode & RIGHT ){
|
else if ( m_nMode & RIGHT ){
|
||||||
x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i])) - text_Hborder_width*2);
|
x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i]), m_utf8_encoded) - text_Hborder_width*2);
|
||||||
if ( m_nMode & SCROLL )
|
if ( m_nMode & SCROLL )
|
||||||
x_center -= SCROLL_FRAME_WIDTH;
|
x_center -= SCROLL_FRAME_WIDTH;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user