diff options
author | erihel <erihel@gmail.com> | 2012-08-18 21:04:51 +0200 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2012-08-18 21:04:51 +0200 |
commit | 8d4a3ed57915af2acf8b3dcd9a8aec5a75806ca6 (patch) | |
tree | ffee78fc822604f9c5c3ab468c8da04862f31283 /src/ui/label.cpp | |
parent | 48ad79a03c12b923dfdb3795a2138445859cf779 (diff) | |
download | colobot-8d4a3ed57915af2acf8b3dcd9a8aec5a75806ca6.tar.gz colobot-8d4a3ed57915af2acf8b3dcd9a8aec5a75806ca6.tar.bz2 colobot-8d4a3ed57915af2acf8b3dcd9a8aec5a75806ca6.zip |
* wrong enum used for text alignment
* wrong event function used
Diffstat (limited to 'src/ui/label.cpp')
-rw-r--r-- | src/ui/label.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/ui/label.cpp b/src/ui/label.cpp index fb5f1d8..c5da211 100644 --- a/src/ui/label.cpp +++ b/src/ui/label.cpp @@ -40,12 +40,8 @@ CLabel::~CLabel() bool CLabel::Create(Math::Point pos, Math::Point dim, int icon, EventType eventMsg) { - Event event; - - if (eventMsg == EVENT_NULL) { - m_event->GetEvent(event); - eventMsg = event.type; - } + if (eventMsg == EVENT_NULL) + eventMsg = GetUniqueEventType(); CControl::Create(pos, dim, icon, eventMsg); return true; @@ -73,9 +69,9 @@ void CLabel::Draw() pos.y = m_pos.y + m_dim.y / 2.0f; switch (m_textAlign) { - case Gfx::TEXT_ALIGN_LEFT: pos.x = m_pos.x; break; + case Gfx::TEXT_ALIGN_RIGHT: 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_RIGHT: pos.x = m_pos.x + m_dim.x; break; + case Gfx::TEXT_ALIGN_LEFT: 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); |