From: Charlie Brej Date: Mon, 22 Mar 2010 23:33:21 +0000 (+0000) Subject: [script] Correctly initialise the minimum width when getting minimal window X-Git-Tag: 0.8.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bbc2437228abb36298606eda4b6bb7d87b2b96e;p=thirdparty%2Fplymouth.git [script] Correctly initialise the minimum width when getting minimal window Values were preset to zero which was the smallest width/height. --- diff --git a/src/plugins/splash/script/script-lib-sprite.c b/src/plugins/splash/script/script-lib-sprite.c index c27ac10c..1baf511d 100644 --- a/src/plugins/splash/script/script-lib-sprite.c +++ b/src/plugins/splash/script/script-lib-sprite.c @@ -230,7 +230,10 @@ static script_return_t sprite_window_get_width (script_state_t *state, node = ply_list_get_next_node (data->displays, node)) { display = ply_list_node_get_data (node); - width = MIN (width, ply_pixel_display_get_width (display->pixel_display)); + if (width == 0) + width = ply_pixel_display_get_width (display->pixel_display); + else + width = MIN (width, ply_pixel_display_get_width (display->pixel_display)); } return script_return_obj (script_obj_new_number (width)); } @@ -267,7 +270,10 @@ static script_return_t sprite_window_get_height (script_state_t *state, node = ply_list_get_next_node (data->displays, node)) { display = ply_list_node_get_data (node); - height = MIN (height, ply_pixel_display_get_height (display->pixel_display)); + if (height == 0) + height = ply_pixel_display_get_height (display->pixel_display); + else + height = MIN (height, ply_pixel_display_get_height (display->pixel_display)); } return script_return_obj (script_obj_new_number (height)); }