summaryrefslogtreecommitdiffstats
path: root/src/ui/label.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/label.cpp')
-rw-r--r--src/ui/label.cpp12
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);