diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-01-19 03:59:43 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-01-19 03:59:43 +0000 |
| commit | 73c8ccf2a900e59f8450ddad57b80a215bb658b4 (patch) | |
| tree | 9f9b663559a3d2629abe37609d918b0761ba0eda /lib/gui/elabel.cpp | |
| parent | b4448ddb042e5f5015125597633e368f17acbcec (diff) | |
| download | enigma2-73c8ccf2a900e59f8450ddad57b80a215bb658b4.tar.gz enigma2-73c8ccf2a900e59f8450ddad57b80a215bb658b4.zip | |
use Components.Input in seek window
Diffstat (limited to 'lib/gui/elabel.cpp')
| -rw-r--r-- | lib/gui/elabel.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/gui/elabel.cpp b/lib/gui/elabel.cpp index 970669c1..3cec3a1c 100644 --- a/lib/gui/elabel.cpp +++ b/lib/gui/elabel.cpp @@ -37,13 +37,18 @@ int eLabel::event(int event, void *data, void *data2) para->setFont(m_font); para->renderString(m_text, 0); para->realign(eTextPara::dirLeft); + int glyphs = para->size(); - para->setGlyphFlag(m_pos, GS_INVERT); - eRect bbox; - bbox = para->getGlyphBBox(m_pos); - printf("BBOX: %d %d %d %d\n", bbox.left(), 0, bbox.width(), size().height()); - bbox = eRect(bbox.left(), 0, bbox.width(), size().height()); - painter.fill(bbox); + if ((m_pos < 0) || (m_pos >= glyphs)) + eWarning("glyph index %d in eLabel out of bounds!"); + else + { + para->setGlyphFlag(m_pos, GS_INVERT); + eRect bbox; + bbox = para->getGlyphBBox(m_pos); + bbox = eRect(bbox.left(), 0, bbox.width(), size().height()); + painter.fill(bbox); + } painter.renderPara(para, ePoint(0, 0)); return 0; |
