honor horizontal alignment also when a mark is present
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 2 Oct 2006 23:47:53 +0000 (23:47 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 2 Oct 2006 23:47:53 +0000 (23:47 +0000)
lib/gui/elabel.cpp

index 5c8e0b7..f64adb2 100644 (file)
@@ -37,7 +37,16 @@ int eLabel::event(int event, void *data, void *data2)
                        ePtr<eTextPara> para = new eTextPara(eRect(0, 0, size().width(), size().height()));
                        para->setFont(m_font);
                        para->renderString(m_text.empty()?0:m_text.c_str(), 0);
-                       para->realign(eTextPara::dirLeft);
+
+                       if (m_halign == alignLeft)
+                               para->realign(eTextPara::dirLeft);
+                       else if (m_halign == alignCenter)
+                               para->realign(eTextPara::dirCenter);
+                       else if (m_halign == alignRight)
+                               para->realign(eTextPara::dirRight);
+                       else if (m_halign == alignBlock)
+                               para->realign(eTextPara::dirBlock);
+
                        int glyphs = para->size();
 
                        if ((m_pos < 0) || (m_pos >= glyphs))