screensaver: fix clock positions

Origin commit data
------------------
Commit: 75d20b6ecb
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-12-19 (Mon, 19 Dec 2016)

Origin message was:
------------------
- screensaver: fix clock positions
This commit is contained in:
vanhofen
2016-12-19 17:21:51 +01:00
parent 85bb0e6abd
commit bc32d98e4d

View File

@@ -294,13 +294,9 @@ void CScreenSaver::paint()
//check position and size use only possible available screen size
int x_cl, y_cl, w_cl, h_cl;
scr_clock->getDimensions(&x_cl, &y_cl, &w_cl, &h_cl);
bool unchecked = true;
while(unchecked){
scr_clock->setPosP(uint8_t(rand() % 100),uint8_t(rand() % 100));
scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl);
if (x_cl+w_cl < g_settings.screen_EndX && y_cl+h_cl < g_settings.screen_EndY)
unchecked = false;
}
int x_random = rand() % ((g_settings.screen_EndX - w_cl - g_settings.screen_StartX) + 1) + g_settings.screen_StartX;
int y_random = rand() % ((g_settings.screen_EndY - h_cl - g_settings.screen_StartY) + 1) + g_settings.screen_StartY;
scr_clock->setPos(x_random, y_random);
scr_clock->Start();
if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) {