Skip to content

Commit 291c7f5

Browse files
reFix whole screen issue when building screenshots
1 parent 1585bea commit 291c7f5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib_nbgl/src/nbgl_obj.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,14 @@ static void compute_position(nbgl_obj_t *obj, nbgl_obj_t *prevObj)
355355
obj->area.y0 = parent->obj.area.y0 + obj->rel_y0;
356356

357357
if ((obj->area.x0 + obj->area.width) > SCREEN_WIDTH) {
358+
#ifdef BUILD_SCREENSHOTS
359+
obj->area.width = SCREEN_WIDTH - obj->area.x0;
360+
// Be sure the area is not empty
361+
if (!obj->area.width) {
362+
obj->area.width = 1;
363+
obj->area.x0 -= 1;
364+
}
365+
#else // BUILD_SCREENSHOTS
358366
LOG_FATAL(OBJ_LOGGER,
359367
"compute_position(), forbidden width, obj->type = %d, x0=%d, width=%d\n",
360368
obj->type,
@@ -363,6 +371,14 @@ static void compute_position(nbgl_obj_t *obj, nbgl_obj_t *prevObj)
363371
}
364372
#ifdef HAVE_SE_TOUCH
365373
if ((obj->area.y0 + obj->area.height) > SCREEN_HEIGHT) {
374+
#ifdef BUILD_SCREENSHOTS
375+
obj->area.height = SCREEN_HEIGHT - obj->area.y0;
376+
// Be sure the area is not empty
377+
if (!obj->area.height) {
378+
obj->area.height = 1;
379+
obj->area.y0 -= 1;
380+
}
381+
#else // BUILD_SCREENSHOTS
366382
LOG_FATAL(OBJ_LOGGER,
367383
"compute_position(), forbidden height, obj->type = %d, y0=%d, height=%d\n",
368384
obj->type,

0 commit comments

Comments
 (0)