album art display: Fix RTL handling for the album art skin tag

AA was broken when an RTL language is used, causing it to not
be displayed.

Also fix th out of bounds handling when width/height > viewport

Change-Id: I4899cd32ec58107c987e3cc0e8df582963bdcf62
This commit is contained in:
Jonathan Gordon 2013-01-15 23:10:37 +11:00
parent d24c220d04
commit d6c6c0767c

View file

@ -1197,16 +1197,16 @@ static int parse_albumart_load(struct skin_element* element,
/* if we got here, we parsed everything ok .. ! */ /* if we got here, we parsed everything ok .. ! */
if (aa->width < 0) if (aa->width < 0)
aa->width = 0; aa->width = 0;
else if (aa->width > LCD_WIDTH) else if (aa->width > curr_vp->vp.width)
aa->width = LCD_WIDTH; aa->width = curr_vp->vp.width;
if (aa->height < 0) if (aa->height < 0)
aa->height = 0; aa->height = 0;
else if (aa->height > LCD_HEIGHT) else if (aa->height > curr_vp->vp.height)
aa->height = LCD_HEIGHT; aa->height = curr_vp->vp.height;
if (swap_for_rtl) if (swap_for_rtl)
aa->x = LCD_WIDTH - (aa->x + aa->width); aa->x = (curr_vp->vp.width - aa->width - aa->x);
aa->state = WPS_ALBUMART_LOAD; aa->state = WPS_ALBUMART_LOAD;
wps_data->albumart = PTRTOSKINOFFSET(skin_buffer, aa); wps_data->albumart = PTRTOSKINOFFSET(skin_buffer, aa);