summaryrefslogtreecommitdiff
path: root/osd.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-01-24 11:42:15 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2013-01-24 11:42:15 +0100
commitcfb62845ec2b164b6e17cdb44c7fe1536527e81d (patch)
tree7ef6e5ed6110d6a573dab07eb90007c643a5addf /osd.c
parent8281be14801ea3feeef358d32ea88ae79d5d12d1 (diff)
downloadvdr-cfb62845ec2b164b6e17cdb44c7fe1536527e81d.tar.gz
vdr-cfb62845ec2b164b6e17cdb44c7fe1536527e81d.tar.bz2
Fixed upscaling bitmaps
Diffstat (limited to 'osd.c')
-rw-r--r--osd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/osd.c b/osd.c
index 75f13f4b..41997606 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 2.33 2012/12/15 11:16:41 kls Exp $
+ * $Id: osd.c 2.34 2013/01/24 11:37:58 kls Exp $
*/
#include "osd.h"
@@ -853,12 +853,12 @@ cBitmap *cBitmap::Scaled(double FactorX, double FactorY, bool AntiAlias)
b->SetBpp(8);
b->Replace(*this); // copy palette (must be done *after* SetBpp()!)
int SourceY = 0;
- for (int y = 0; y < b->Height() - 1; y++) {
+ for (int y = 0; y < b->Height(); y++) {
int SourceX = 0;
- int sy = SourceY >> 16;
+ int sy = min(SourceY >> 16, Height() - 2);
uint8_t BlendY = 0xFF - ((SourceY >> 8) & 0xFF);
- for (int x = 0; x < b->Width() - 1; x++) {
- int sx = SourceX >> 16;
+ for (int x = 0; x < b->Width(); x++) {
+ int sx = min(SourceX >> 16, Width() - 2);
uint8_t BlendX = 0xFF - ((SourceX >> 8) & 0xFF);
tColor c1 = b->Blend(GetColor(sx, sy), GetColor(sx + 1, sy), BlendX);
tColor c2 = b->Blend(GetColor(sx, sy + 1), GetColor(sx + 1, sy + 1), BlendX);