diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2018-06-24 16:09:19 +0200 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2018-06-24 16:09:19 +0200 |
commit | 9f49ddbd7ce4969c713d850a7b17123b17f3288f (patch) | |
tree | 80983c2043d2e795b551db7e2d7f8cf874c5bc6c /complexcontent.c | |
parent | 5a8c1819d963bc78c317b98dd2e77be68bad1549 (diff) | |
download | skin-flatplus-9f49ddbd7ce4969c713d850a7b17123b17f3288f.tar.gz skin-flatplus-9f49ddbd7ce4969c713d850a7b17123b17f3288f.tar.bz2 |
support for MaxPixmapSize
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() ); |