diff options
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r-- | apps/gui/viewport.c | 6 |
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; |