Skip to content

Commit 1585bea

Browse files
Revert "Fix whole screen issue when building screenshots"
This reverts commit 82af3eb.
1 parent f890489 commit 1585bea

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

lib_nbgl/src/nbgl_obj.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -353,38 +353,21 @@ static void compute_position(nbgl_obj_t *obj, nbgl_obj_t *prevObj)
353353

354354
obj->area.x0 = parent->obj.area.x0 + obj->rel_x0;
355355
obj->area.y0 = parent->obj.area.y0 + obj->rel_y0;
356-
if ((obj->area.x0 + obj->area.width) > (parent->obj.area.x0 + parent->obj.area.width)) {
357-
#ifdef BUILD_SCREENSHOTS
358-
obj->area.width = parent->obj.area.x0 + parent->obj.area.width - obj->area.x0;
359-
// Be sure the area is not empty
360-
if (!obj->area.width) {
361-
obj->area.width = 1;
362-
obj->area.x0 -= 1;
363-
}
364-
#else // BUILD_SCREENSHOTS
356+
357+
if ((obj->area.x0 + obj->area.width) > SCREEN_WIDTH) {
365358
LOG_FATAL(OBJ_LOGGER,
366359
"compute_position(), forbidden width, obj->type = %d, x0=%d, width=%d\n",
367360
obj->type,
368361
obj->area.x0,
369362
obj->area.width);
370-
#endif // BUILD_SCREENSHOTS
371363
}
372364
#ifdef HAVE_SE_TOUCH
373-
if ((obj->area.y0 + obj->area.height) > (parent->obj.area.y0 + parent->obj.area.height)) {
374-
#ifdef BUILD_SCREENSHOTS
375-
obj->area.height = parent->obj.area.y0 + parent->obj.area.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
365+
if ((obj->area.y0 + obj->area.height) > SCREEN_HEIGHT) {
382366
LOG_FATAL(OBJ_LOGGER,
383367
"compute_position(), forbidden height, obj->type = %d, y0=%d, height=%d\n",
384368
obj->type,
385369
obj->area.y0,
386370
obj->area.height);
387-
#endif // BUILD_SCREENSHOTS
388371
}
389372
#endif // HAVE_SE_TOUCH
390373
}

0 commit comments

Comments
 (0)