mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
- screensaver: fix clock positions
This commit is contained in:
@@ -283,14 +283,10 @@ 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;
|
||||
}
|
||||
scr_clock->getDimensions(&x_cl, &y_cl, &w_cl, &h_cl);
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user