From 5771ff5f945a06393186ea5798bfab2a0eb3a35c Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 9 Jun 2013 13:25:36 +0200 Subject: [PATCH] driver/screen_max: don't return negative start coordinates --- src/driver/screen_max.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/driver/screen_max.cpp b/src/driver/screen_max.cpp index 601d46206..c318c3061 100644 --- a/src/driver/screen_max.cpp +++ b/src/driver/screen_max.cpp @@ -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; }