mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
- screensaver: fix clock positions
This commit is contained in:
@@ -284,13 +284,9 @@ void CScreenSaver::paint()
|
|||||||
//check position and size use only possible available screen size
|
//check position and size use only possible available screen size
|
||||||
int x_cl, y_cl, w_cl, h_cl;
|
int x_cl, y_cl, w_cl, h_cl;
|
||||||
scr_clock->getDimensions(&x_cl, &y_cl, &w_cl, &h_cl);
|
scr_clock->getDimensions(&x_cl, &y_cl, &w_cl, &h_cl);
|
||||||
bool unchecked = true;
|
int x_random = rand() % ((g_settings.screen_EndX - w_cl - g_settings.screen_StartX) + 1) + g_settings.screen_StartX;
|
||||||
while(unchecked){
|
int y_random = rand() % ((g_settings.screen_EndY - h_cl - g_settings.screen_StartY) + 1) + g_settings.screen_StartY;
|
||||||
scr_clock->setPosP(uint8_t(rand() % 100),uint8_t(rand() % 100));
|
scr_clock->setPos(x_random, y_random);
|
||||||
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->Start();
|
scr_clock->Start();
|
||||||
|
|
||||||
if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) {
|
if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) {
|
||||||
|
Reference in New Issue
Block a user