driver/screen_max: don't return negative start coordinates

Origin commit data
------------------
Branch: ni/coolstream
Commit: 5771ff5f94
Author: martii <m4rtii@gmx.de>
Date: 2013-06-09 (Sun, 09 Jun 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-06-09 13:25:36 +02:00
committed by [CST] Focus
parent 2778c51fa2
commit e0e5c5de42

View File

@@ -61,15 +61,15 @@ int h_max (int h_size, int h_add)
int getScreenStartX (int width)
{
int w = width;
return (((g_settings.screen_EndX- g_settings.screen_StartX)-w) / 2) + g_settings.screen_StartX;
int r = (((g_settings.screen_EndX- g_settings.screen_StartX)-w) / 2) + g_settings.screen_StartX;
return r < 0 ? 0 : r;
}
int getScreenStartY (int height)
{
int y = height;
return (((g_settings.screen_EndY- g_settings.screen_StartY)-y) / 2) + g_settings.screen_StartY;
int r = (((g_settings.screen_EndY- g_settings.screen_StartY)-y) / 2) + g_settings.screen_StartY;
return r < 0 ? 0 : r;
}