summaryrefslogtreecommitdiff
path: root/textwindow.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-04-13 15:40:46 +0200
committerlouis <louis.braun@gmx.de>2013-04-13 15:40:46 +0200
commit4cfdca4afe04f9f4055800b1622f9122f87287ba (patch)
tree6b3f12d84b8d205b298e885e6681bd202009a816 /textwindow.c
parent24bb51ba0d1b86f0a3d7e4ee1e5607aa9246b5d7 (diff)
downloadskin-nopacity-4cfdca4afe04f9f4055800b1622f9122f87287ba.tar.gz
skin-nopacity-4cfdca4afe04f9f4055800b1622f9122f87287ba.tar.bz2
Added debug for scaling
Diffstat (limited to 'textwindow.c')
-rw-r--r--textwindow.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/textwindow.c b/textwindow.c
index 04ea9b4..71e020e 100644
--- a/textwindow.c
+++ b/textwindow.c
@@ -22,10 +22,13 @@ cNopacityTextWindow::~cNopacityTextWindow(void) {
pixmap = NULL;
}
if ((config.scalePicture == 2) && scaledWindow) {
- vidWin->SetX(oldVidWin.X());
- vidWin->SetY(oldVidWin.Y());
- vidWin->SetWidth(oldVidWin.Width());
- vidWin->SetHeight(oldVidWin.Height());
+ cRect vidWinNew = cDevice::PrimaryDevice()->CanScaleVideo(oldVidWin);
+ if (vidWinNew != cRect::Null) {
+ vidWin->SetX(vidWinNew.X());
+ vidWin->SetY(vidWinNew.Y());
+ vidWin->SetWidth(vidWinNew.Width());
+ vidWin->SetHeight(vidWinNew.Height());
+ }
}
}
@@ -73,17 +76,19 @@ void cNopacityTextWindow::Action(void) {
DoSleep(config.menuInfoTextDelay*1000);
if (config.scalePicture == 2) {
- cRect availableRect(vidWin->X(), vidWin->Y(), vidWin->Width(), vidWin->Height() - geometry->Height());
oldVidWin.SetX(vidWin->X());
oldVidWin.SetY(vidWin->Y());
oldVidWin.SetWidth(vidWin->Width());
oldVidWin.SetHeight(vidWin->Height());
+ cRect availableRect(vidWin->X(), vidWin->Y(), vidWin->Width(), vidWin->Height() - geometry->Height());
cRect vidWinNew = cDevice::PrimaryDevice()->CanScaleVideo(availableRect);
- vidWin->SetX(vidWinNew.X());
- vidWin->SetY(vidWinNew.Y());
- vidWin->SetWidth(vidWinNew.Width());
- vidWin->SetHeight(vidWinNew.Height());
- scaledWindow = true;
+ if (vidWinNew != cRect::Null) {
+ vidWin->SetX(vidWinNew.X());
+ vidWin->SetY(vidWinNew.Y());
+ vidWin->SetWidth(vidWinNew.Width());
+ vidWin->SetHeight(vidWinNew.Height());
+ scaledWindow = true;
+ }
}
int border = 5;