1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jonathan Gordon 2009-10-28 06:44:37 +00:00
parent a30f25ddd4
commit bee5900032
3 changed files with 15 additions and 3 deletions

View file

@ -945,7 +945,7 @@ const char* parse_list(const char *fmt, uint32_t *set_vals,
const char* p = str, *f = fmt;
const char** s;
int* d;
bool set;
bool set, is_negative;
int i=0;
va_start(ap, str);
@ -973,7 +973,13 @@ const char* parse_list(const char *fmt, uint32_t *set_vals,
break;
case 'd': /* int */
is_negative = false;
d = va_arg(ap, int*);
if (*p == '-' && isdigit(*(p+1)))
{
is_negative = true;
p++;
}
if (!isdigit(*p))
{
if (!set_vals || *p != '-')
@ -987,6 +993,8 @@ const char* parse_list(const char *fmt, uint32_t *set_vals,
while (isdigit(*p))
*d = (*d * 10) + (*p++ - '0');
set = true;
if (is_negative)
*d *= -1;
}
break;