From d9d45c45572aed8728bd9b0792c7e03dd4ea93a2 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Fri, 6 Jan 2012 02:01:28 -0600 Subject: [PATCH] handle e.g. 320x240 backgrounds in scale_or_crop_backgrounds() --- Themes/_fallback/Scripts/02 Actor.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Themes/_fallback/Scripts/02 Actor.lua b/Themes/_fallback/Scripts/02 Actor.lua index 626559ef5a..b1a40f2a5f 100644 --- a/Themes/_fallback/Scripts/02 Actor.lua +++ b/Themes/_fallback/Scripts/02 Actor.lua @@ -168,7 +168,12 @@ function Actor:scale_or_crop_background() -- bga matches the current aspect, we can stretch it. self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT ) else - self:scaletofit( SCREEN_CENTER_X-(gw/2),SCREEN_TOP,SCREEN_CENTER_X+(gw/2),SCREEN_HEIGHT) + if gh < DISPLAY:GetDisplayHeight() then + -- we have a bg smaller than the display height. we need to scale it up. + self:scaletofit( SCREEN_CENTER_X-((graphicAspect*SCREEN_HEIGHT)/2),SCREEN_TOP,SCREEN_CENTER_X+((graphicAspect*SCREEN_HEIGHT)/2),SCREEN_HEIGHT) + else + self:scaletofit( SCREEN_CENTER_X-(gw/2),SCREEN_TOP,SCREEN_CENTER_X+(gw/2),SCREEN_HEIGHT) + end end end