summaryrefslogtreecommitdiff
path: root/apps/gui/viewport.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-10-28 06:44:37 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-10-28 06:44:37 +0000
commitbee59000324bfd74a38d6d652dae62fc61b3b344 (patch)
tree1f210c42661e3f2bc3de3d0e73e0e2c635b43611 /apps/gui/viewport.c
parenta30f25ddd422c3bf39a6c9964b25c3a7b01676b3 (diff)
downloadrockbox-bee59000324bfd74a38d6d652dae62fc61b3b344.tar.gz
rockbox-bee59000324bfd74a38d6d652dae62fc61b3b344.zip
Allow the x and y pixel values of viewports to be a negative number..
%V|-50|0|-|..... will position that viewport 50 pixels from the right of the display at the top. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23378 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r--apps/gui/viewport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index f39a299521..9bf0e80179 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -445,7 +445,11 @@ const char* viewport_parse_viewport(struct viewport *vp,
445 /* X and Y *must* be set */ 445 /* X and Y *must* be set */
446 if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) 446 if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y))
447 return NULL; 447 return NULL;
448 448 /* check for negative values */
449 if (vp->x < 0)
450 vp->x += screens[screen].lcdwidth;
451 if (vp->y < 0)
452 vp->y += screens[screen].lcdheight;
449 /* fix defaults */ 453 /* fix defaults */
450 if (!LIST_VALUE_PARSED(set, PL_WIDTH)) 454 if (!LIST_VALUE_PARSED(set, PL_WIDTH))
451 vp->width = screens[screen].lcdwidth - vp->x; 455 vp->width = screens[screen].lcdwidth - vp->x;