X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e3922901f71a44a74c320504a4a61f7b2906aaf2..7373f39fe2ebe1b5007ed56ddd86d9ce0ad3efb7:/lib/gui/esubtitle.cpp diff --git a/lib/gui/esubtitle.cpp b/lib/gui/esubtitle.cpp index f3d0e35f..594ed8a8 100644 --- a/lib/gui/esubtitle.cpp +++ b/lib/gui/esubtitle.cpp @@ -62,8 +62,9 @@ void eSubtitleWidget::setPage(const eDVBSubtitlePage &p) for (std::list::iterator it(m_dvb_page.m_regions.begin()); it != m_dvb_page.m_regions.end(); ++it) { eDebug("add %d %d %d %d", it->m_position.x(), it->m_position.y(), it->m_pixmap->size().width(), it->m_pixmap->size().height()); + eDebug("disp width %d, disp height %d", p.m_display_size.width(), p.m_display_size.height()); eRect r = eRect(it->m_position, it->m_pixmap->size()); - r.scale(size().width(), 720, size().height(), 576); + r.scale(size().width(), p.m_display_size.width(), size().height(), p.m_display_size.height()); m_visible_region.rects.push_back(r); } m_dvb_page_ok = 1; @@ -115,9 +116,14 @@ void eSubtitleWidget::clearPage() void eSubtitleWidget::setPixmap(ePtr &pixmap, gRegion changed, eRect pixmap_dest) { m_pixmap = pixmap; - m_pixmap_dest = pixmap_dest; + m_pixmap_dest = pixmap_dest; /* this is in a virtual 720x576 cage */ - changed.scale(size().width(), pixmap->size().width(), size().height(), pixmap->size().height()); + /* incoming "changed" regions are relative to the physical pixmap area, so they have to be scaled to the virtual pixmap area, then to the screen */ + changed.scale(m_pixmap_dest.width(), 720, m_pixmap_dest.height(), 576); + changed.moveBy(ePoint(m_pixmap_dest.x(), m_pixmap_dest.y())); + + if (pixmap->size().width() && pixmap->size().height()) + changed.scale(size().width(), pixmap->size().width(), size().height(), pixmap->size().height()); invalidate(changed); } @@ -202,9 +208,8 @@ int eSubtitleWidget::event(int event, void *data, void *data2) { for (std::list::iterator it(m_dvb_page.m_regions.begin()); it != m_dvb_page.m_regions.end(); ++it) { - /* dvb subtitles are living in their 720x576 cage... i think. check this for HD. */ eRect r = eRect(it->m_position, it->m_pixmap->size()); - r.scale(size().width(), 720, size().height(), 576); + r.scale(size().width(), m_dvb_page.m_display_size.width(), size().height(), m_dvb_page.m_display_size.height()); painter.blitScale(it->m_pixmap, r); } }