Ticket #11186: diff.txt

File diff.txt, 932 bytes (added by john.p.harvey@…, 13 years ago)

patch to fix this problem.

Line 
1diff --git a/mythtv/libs/libmythtv/subtitlescreen.cpp b/mythtv/libs/libmythtv/subtitlescreen.cpp
2index 73cd8c1..86633b6 100644
3--- a/mythtv/libs/libmythtv/subtitlescreen.cpp
4+++ b/mythtv/libs/libmythtv/subtitlescreen.cpp
5@@ -1392,6 +1392,24 @@ void SubtitleScreen::AddScaledImage(QImage &img, QRect &pos)
6 {
7 img = img.scaled(scaled.width(), scaled.height(),
8 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
9+
10+ // If scaled image is off left ot top then crop it to start at 0,0
11+ if (scaled.x() < 0 || scaled.y() < 0)
12+ {
13+ int x= 0;
14+ int y = 0;
15+ if (scaled.x() < 0)
16+ x = -scaled.x();
17+ if (scaled.y() < 0)
18+ y = -scaled.y();
19+
20+
21+ img = img.copy(x, y, scaled.width()-x, scaled.height()-y);
22+ if (scaled.x() < 0)
23+ scaled.setX(0);
24+ if (scaled.y() < 0)
25+ scaled.setY(0);
26+ }
27 }
28
29 MythPainter *osd_painter = vo->GetOSDPainter();