diff options
Diffstat (limited to 'complexcontent.c')
-rw-r--r-- | complexcontent.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/complexcontent.c b/complexcontent.c index 7c265414..c66d6989 100644 --- a/complexcontent.c +++ b/complexcontent.c @@ -36,6 +36,22 @@ void cComplexContent::Clear(void) { } } +cPixmap *cComplexContent::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) { + cSize maxPixmapSize = Osd->MaxPixmapSize(); + cRect SafeDrawPort( DrawPort.X(), DrawPort.Y(), DrawPort.Width(), DrawPort.Height()); + + if( DrawPort.Width() > maxPixmapSize.Width() ) { + dsyslog("Try to create Pixmap (%d x %d) > MaxPixmapSize (%d x %d)-> cut Pixmap to MaxPixmapSize", DrawPort.Width(), DrawPort.Height(), maxPixmapSize.Width(), maxPixmapSize.Height() ); + SafeDrawPort.SetWidth(maxPixmapSize.Width()); + } + if( DrawPort.Height() > maxPixmapSize.Height() ) { + dsyslog("Try to create Pixmap (%d x %d) > MaxPixmapSize (%d x %d)-> cut Pixmap to MaxPixmapSize", DrawPort.Width(), DrawPort.Height(), maxPixmapSize.Width(), maxPixmapSize.Height() ); + SafeDrawPort.SetHeight(maxPixmapSize.Height()); + } + + return Osd->CreatePixmap(Layer, ViewPort, SafeDrawPort); +} + void cComplexContent::CreatePixmaps(bool fullFillBackground) { CalculateDrawPortHeight(); FullFillBackground = fullFillBackground; @@ -60,8 +76,8 @@ void cComplexContent::CreatePixmaps(bool fullFillBackground) { else PositionDraw.SetHeight(DrawPortHeight); - Pixmap = Osd->CreatePixmap(1, Position, PositionDraw); - PixmapImage = Osd->CreatePixmap(2, Position, PositionDraw); + Pixmap = CreatePixmap(1, Position, PositionDraw); + PixmapImage = CreatePixmap(2, Position, PositionDraw); //dsyslog("skinflatplus: ComplexContentPixmap left: %d top: %d width: %d height: %d", Position.Left(), Position.Top(), Position.Width(), Position.Height() ); //dsyslog("skinflatplus: ComplexContentPixmap drawport left: %d top: %d width: %d height: %d", PositionDraw.Left(), PositionDraw.Top(), PositionDraw.Width(), PositionDraw.Height() ); |