Fixed invalid text alignment
parent
4b67386a69
commit
da5d4edeb3
|
@ -941,7 +941,7 @@ void CEdit::Draw()
|
|||
for ( j=0 ; j<m_lineIndent[i] ; j++ )
|
||||
{
|
||||
char s = '\t'; // line | dotted
|
||||
m_engine->GetText()->DrawText(&s, m_fontType, m_fontSize, pos, 1.0f, Gfx::TEXT_ALIGN_RIGHT, 0);
|
||||
m_engine->GetText()->DrawText(&s, m_fontType, m_fontSize, pos, 1.0f, Gfx::TEXT_ALIGN_LEFT, 0);
|
||||
pos.x += indentLength;
|
||||
}
|
||||
}
|
||||
|
@ -1063,7 +1063,7 @@ void CEdit::Draw()
|
|||
if ( !m_bMulti || !m_bDisplaySpec ) eol = 0;
|
||||
if ( m_format.size() == 0 )
|
||||
{
|
||||
m_engine->GetText()->DrawText(std::string(m_text+beg), m_fontType, size, ppos, m_dim.x, Gfx::TEXT_ALIGN_RIGHT, eol);
|
||||
m_engine->GetText()->DrawText(std::string(m_text+beg), m_fontType, size, ppos, m_dim.x, Gfx::TEXT_ALIGN_LEFT, eol);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1072,7 +1072,7 @@ void CEdit::Draw()
|
|||
size,
|
||||
ppos,
|
||||
m_dim.x,
|
||||
Gfx::TEXT_ALIGN_RIGHT,
|
||||
Gfx::TEXT_ALIGN_LEFT,
|
||||
eol);
|
||||
}
|
||||
|
||||
|
@ -1104,14 +1104,14 @@ void CEdit::Draw()
|
|||
if ( m_format.size() == 0 )
|
||||
{
|
||||
m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]), m_fontType,
|
||||
size, pos, Gfx::TEXT_ALIGN_RIGHT,
|
||||
size, pos, Gfx::TEXT_ALIGN_LEFT,
|
||||
start, end);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]),
|
||||
std::vector<Gfx::FontMetaChar>(m_format.begin()+m_lineOffset[i], m_format.end()),
|
||||
size, pos, Gfx::TEXT_ALIGN_RIGHT,
|
||||
size, pos, Gfx::TEXT_ALIGN_LEFT,
|
||||
start, end);
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ void CKey::Draw()
|
|||
pos.x = m_pos.x + (214.0f / 640.0f);
|
||||
pos.y = m_pos.y + m_dim.y * 0.5f;
|
||||
pos.y -= h;
|
||||
m_engine->GetText()->DrawText(std::string(m_name), m_fontType, m_fontSize, pos, m_dim.x, Gfx::TEXT_ALIGN_RIGHT, 0);
|
||||
m_engine->GetText()->DrawText(std::string(m_name), m_fontType, m_fontSize, pos, m_dim.x, Gfx::TEXT_ALIGN_LEFT, 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -69,9 +69,9 @@ void CLabel::Draw()
|
|||
pos.y = m_pos.y + m_dim.y / 2.0f;
|
||||
|
||||
switch (m_textAlign) {
|
||||
case Gfx::TEXT_ALIGN_RIGHT: pos.x = m_pos.x; break;
|
||||
case Gfx::TEXT_ALIGN_LEFT: pos.x = m_pos.x; break;
|
||||
case Gfx::TEXT_ALIGN_CENTER: pos.x = m_pos.x + m_dim.x / 2.0f; break;
|
||||
case Gfx::TEXT_ALIGN_LEFT: pos.x = m_pos.x + m_dim.x; break;
|
||||
case Gfx::TEXT_ALIGN_RIGHT: pos.x = m_pos.x + m_dim.x; break;
|
||||
}
|
||||
|
||||
m_engine->GetText()->DrawText(std::string(m_name), m_fontType, m_fontSize, pos, m_dim.x, m_textAlign, 0);
|
||||
|
|
|
@ -43,7 +43,7 @@ CList::CList() : CControl()
|
|||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
m_tabs[i] = 0.0f;
|
||||
m_justifs[i] = Gfx::TEXT_ALIGN_RIGHT;
|
||||
m_justifs[i] = Gfx::TEXT_ALIGN_LEFT;
|
||||
}
|
||||
|
||||
m_totalLine = 0;
|
||||
|
@ -128,7 +128,7 @@ bool CList::MoveAdjust()
|
|||
for (int i = 0; i < m_displayLine; i++) {
|
||||
m_button[i] = new CButton();
|
||||
m_button[i]->Create(ppos, ddim, -1, EVENT_NULL);
|
||||
m_button[i]->SetTextAlign(Gfx::TEXT_ALIGN_RIGHT);
|
||||
m_button[i]->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
|
||||
m_button[i]->SetState(STATE_SIMPLY);
|
||||
m_button[i]->SetFontType(m_fontType);
|
||||
m_button[i]->SetFontSize(m_fontSize);
|
||||
|
@ -414,7 +414,7 @@ void CList::Draw()
|
|||
ppos.y = pos.y + dim.y * 0.5f;
|
||||
ppos.y -= m_engine->GetText()->GetHeight(m_fontType, m_fontSize) / 2.0f;
|
||||
ddim.x = dim.x-dim.y;
|
||||
DrawCase(m_text[i + m_firstLine], ppos, ddim.x, Gfx::TEXT_ALIGN_RIGHT);
|
||||
DrawCase(m_text[i + m_firstLine], ppos, ddim.x, Gfx::TEXT_ALIGN_LEFT);
|
||||
} else {
|
||||
ppos.x = pos.x + dim.y * 0.5f;
|
||||
ppos.y = pos.y + dim.y * 0.5f;
|
||||
|
@ -504,7 +504,7 @@ void CList::DrawCase(char *text, Math::Point pos, float width, Gfx::TextAlign ju
|
|||
{
|
||||
if (justif == Gfx::TEXT_ALIGN_CENTER)
|
||||
pos.x += width / 2.0f;
|
||||
else if (justif == Gfx::TEXT_ALIGN_LEFT)
|
||||
else if (justif == Gfx::TEXT_ALIGN_RIGHT)
|
||||
pos.x += width;
|
||||
m_engine->GetText()->DrawText(std::string(text), m_fontType, m_fontSize, pos, width, justif, 0);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ class CList : public CControl
|
|||
void SetEnable(int i, bool bEnable);
|
||||
bool GetEnable(int i);
|
||||
|
||||
void SetTabs(int i, float pos, Gfx::TextAlign justif=Gfx::TEXT_ALIGN_CENTER);
|
||||
void SetTabs(int i, float pos, Gfx::TextAlign justif=Gfx::TEXT_ALIGN_LEFT);
|
||||
float GetTabs(int i);
|
||||
|
||||
void ShowSelect(bool bFixed);
|
||||
|
|
|
@ -471,7 +471,7 @@ void CSlider::Draw()
|
|||
h = m_engine->GetText()->GetHeight(m_fontType, m_fontSize);
|
||||
pos.x = m_pos.x+m_dim.x+(10.0f/640.0f);
|
||||
pos.y = m_pos.y+(m_dim.y-h)/2.0f;
|
||||
m_engine->GetText()->DrawText(text, m_fontType, m_fontSize, pos, m_dim.x, Gfx::TEXT_ALIGN_RIGHT, 0);
|
||||
m_engine->GetText()->DrawText(text, m_fontType, m_fontSize, pos, m_dim.x, Gfx::TEXT_ALIGN_LEFT, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -484,7 +484,7 @@ void CSlider::Draw()
|
|||
dim.x = 50.0f/640.0f;
|
||||
dim.y = 16.0f/480.0f;
|
||||
sprintf(text, "%d", (int)(m_min+(m_visibleValue*(m_max-m_min))));
|
||||
m_engine->GetText()->DrawText(text, m_fontType, m_fontSize, pos, dim.x, Gfx::TEXT_ALIGN_RIGHT, 0);
|
||||
m_engine->GetText()->DrawText(text, m_fontType, m_fontSize, pos, dim.x, Gfx::TEXT_ALIGN_LEFT, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1090,14 +1090,14 @@ void CStudio::StartDialog(StudioDialog type)
|
|||
{
|
||||
GetResource(RES_TEXT, RT_IO_LIST, name);
|
||||
pla = pw->CreateLabel(pos, dim, 0, EVENT_DIALOG_LABEL1, name);
|
||||
pla->SetTextAlign(Gfx::TEXT_ALIGN_RIGHT);
|
||||
pla->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
|
||||
|
||||
pli = pw->CreateList(pos, dim, 0, EVENT_DIALOG_LIST);
|
||||
pli->SetState(STATE_SHADOW);
|
||||
|
||||
GetResource(RES_TEXT, RT_IO_NAME, name);
|
||||
pla = pw->CreateLabel(pos, dim, 0, EVENT_DIALOG_LABEL2, name);
|
||||
pla->SetTextAlign(Gfx::TEXT_ALIGN_RIGHT);
|
||||
pla->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
|
||||
|
||||
pe = pw->CreateEdit(pos, dim, 0, EVENT_DIALOG_EDIT);
|
||||
pe->SetState(STATE_SHADOW);
|
||||
|
@ -1108,7 +1108,7 @@ void CStudio::StartDialog(StudioDialog type)
|
|||
|
||||
GetResource(RES_TEXT, RT_IO_DIR, name);
|
||||
pla = pw->CreateLabel(pos, dim, 0, EVENT_DIALOG_LABEL3, name);
|
||||
pla->SetTextAlign(Gfx::TEXT_ALIGN_RIGHT);
|
||||
pla->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
|
||||
|
||||
pc = pw->CreateCheck(pos, dim, 0, EVENT_DIALOG_CHECK1);
|
||||
GetResource(RES_TEXT, RT_IO_PRIVATE, name);
|
||||
|
@ -1233,7 +1233,7 @@ void CStudio::AdjustDialog()
|
|||
pli->SetPos(ppos);
|
||||
pli->SetDim(ddim);
|
||||
pli->SetTabs(0, ddim.x-(50.0f+130.0f+16.0f)/640.0f);
|
||||
pli->SetTabs(1, 50.0f/640.0f, Gfx::TEXT_ALIGN_LEFT);
|
||||
pli->SetTabs(1, 50.0f/640.0f, Gfx::TEXT_ALIGN_RIGHT);
|
||||
pli->SetTabs(2, 130.0f/640.0f);
|
||||
//? pli->ShowSelect();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue