1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Changed cBitmap::DrawText() to always draw the background unless ColorBg is clrTransparent

This commit is contained in:
Klaus Schmidinger 2007-08-17 15:31:18 +02:00
parent 4d0297b804
commit 48da9ba9c8
3 changed files with 11 additions and 9 deletions

View File

@ -1981,6 +1981,8 @@ Christoph Haubrich <christoph1.haubrich@arcor.de>
for suggestions that led to implementing cOsd::SetOsdPosition() etc. for suggestions that led to implementing cOsd::SetOsdPosition() etc.
for fixing a typo in the function name of cOsd::SetOsdPosition() and adding a range for fixing a typo in the function name of cOsd::SetOsdPosition() and adding a range
check to it check to it
for changing cBitmap::DrawText() to always draw the background unless ColorBg
is clrTransparent
Pekka Mauno <pekka.mauno@iki.fi> Pekka Mauno <pekka.mauno@iki.fi>
for fixing cSchedule::GetFollowingEvent() in case there is currently no present for fixing cSchedule::GetFollowingEvent() in case there is currently no present

View File

@ -5370,3 +5370,5 @@ Video Disk Recorder Revision History
- Optimized cNitFilter::Process() (thanks to Tobias Bratfisch). - Optimized cNitFilter::Process() (thanks to Tobias Bratfisch).
- Reduced the number of time(NULL) calls in vdr.c's main loop to a single call - Reduced the number of time(NULL) calls in vdr.c's main loop to a single call
(thanks to Tobias Bratfisch). (thanks to Tobias Bratfisch).
- Changed cBitmap::DrawText() to always draw the background unless ColorBg
is clrTransparent (thanks to Christoph Haubrich).

16
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: osd.c 1.72 2007/08/12 11:33:17 kls Exp $ * $Id: osd.c 1.73 2007/08/17 15:23:50 kls Exp $
*/ */
#include "osd.h" #include "osd.h"
@ -449,13 +449,13 @@ void cBitmap::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Color
int w = Font->Width(s); int w = Font->Width(s);
int h = Font->Height(); int h = Font->Height();
int limit = 0; int limit = 0;
int cw = Width ? Width : w;
int ch = Height ? Height : h;
if (!Intersects(x, y, x + cw - 1, y + ch - 1))
return;
if (ColorBg != clrTransparent)
DrawRectangle(x, y, x + cw - 1, y + ch - 1, ColorBg);
if (Width || Height) { if (Width || Height) {
int cw = Width ? Width : w;
int ch = Height ? Height : h;
if (!Intersects(x, y, x + cw - 1, y + ch - 1))
return;
if (ColorBg != clrTransparent)
DrawRectangle(x, y, x + cw - 1, y + ch - 1, ColorBg);
limit = x + cw - x0; limit = x + cw - x0;
if (Width) { if (Width) {
if ((Alignment & taLeft) != 0) if ((Alignment & taLeft) != 0)
@ -482,8 +482,6 @@ void cBitmap::DrawText(int x, int y, const char *s, tColor ColorFg, tColor Color
} }
} }
} }
else if (!Intersects(x, y, x + w - 1, y + h - 1))
return;
x -= x0; x -= x0;
y -= y0; y -= y0;
Font->DrawText(this, x, y, s, ColorFg, ColorBg, limit); Font->DrawText(this, x, y, s, ColorFg, ColorBg, limit);