Permalink
Browse files

DVD: Fix dvd button positioning.

Refs #9860

Signed-off-by: Mark Kendall <mkendall@mythtv.org>
  • Loading branch information...
1 parent 2f52fae commit 801aebf29793b955b53897bd383d5c83101b4434 martin committed with Mark Kendall Jun 23, 2011
Showing with 7 additions and 15 deletions.
  1. +3 −12 mythtv/libs/libmythtv/dvdringbuffer.cpp
  2. +4 −3 mythtv/libs/libmythtv/subtitlescreen.cpp
@@ -1245,9 +1245,7 @@ AVSubtitle *DVDRingBuffer::GetMenuSubtitle(uint &version)
// this is unlocked by ReleaseMenuButton
m_menuBtnLock.lock();
- if ((m_menuBuflength > 4) && m_buttonExists && (NumMenuButtons() > 0) &&
- (m_dvdMenuButton.rects[0]->h >= m_hl_button.height()) &&
- (m_dvdMenuButton.rects[0]->w >= m_hl_button.width()))
+ if ((m_menuBuflength > 4) && m_buttonExists && (NumMenuButtons() > 0))
{
version = m_buttonVersion;
return &(m_dvdMenuButton);
@@ -1270,15 +1268,8 @@ QRect DVDRingBuffer::GetButtonCoords(void)
if (!m_buttonExists)
return rect;
- int x1, y1;
- int x = 0; int y = 0;
- x1 = m_dvdMenuButton.rects[0]->x;
- y1 = m_dvdMenuButton.rects[0]->y;
- if (m_hl_button.x() > x1)
- x = m_hl_button.x() - x1;
- if (m_hl_button.y() > y1)
- y = m_hl_button.y() - y1;
- rect.setRect(x, y, m_hl_button.width(), m_hl_button.height());
+ rect.setRect(m_hl_button.x(), m_hl_button.y(), m_hl_button.width(),
+ m_hl_button.height());
return rect;
}
@@ -560,7 +560,9 @@ void SubtitleScreen::DisplayDVDButton(AVSubtitle* dvdButton, QRect &buttonPos)
VERBOSE(VB_PLAYBACK, LOC + "Added DVD button background");
}
- QImage fg_image = bg_image.copy(buttonPos);
+ // copy button region of background image
+ QRect fg_rect(buttonPos.translated(-hl_button->x, -hl_button->y));
+ QImage fg_image = bg_image.copy(fg_rect);
QVector<unsigned int> fg_palette;
uint32_t *fgpalette = (uint32_t *)(dvdButton->rects[1]->pict.data[1]);
if (fgpalette)
@@ -571,9 +573,8 @@ void SubtitleScreen::DisplayDVDButton(AVSubtitle* dvdButton, QRect &buttonPos)
}
// scale highlight image to match OSD size, if required
- QRect button = buttonPos.adjusted(0, 2, 0, 0);
fg_image = fg_image.convertToFormat(QImage::Format_ARGB32);
- AddScaledImage(fg_image, button);
+ AddScaledImage(fg_image, buttonPos);
}
void SubtitleScreen::DisplayCC608Subtitles(void)

0 comments on commit 801aebf

Please sign in to comment.