From 0d81b89472133b798f33d74a745abdbaef3b3d7d Mon Sep 17 00:00:00 2001 From: zhang sanshan Date: Wed, 7 Aug 2019 16:21:10 +0800 Subject: [PATCH] Recovery UI meet issue if image size is too large When display screen size is too small, some images in recovery resource cannot caculate the right display position. So the image cannot show in the screen. Limit the calculated position to avoid such issue. Change-Id: Iebebfe0dfbc568ee3a6b6a31b81d060b3ce5f940 Signed-off-by: zhang sanshan --- recovery_ui/screen_ui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recovery_ui/screen_ui.cpp b/recovery_ui/screen_ui.cpp index 087fc0e8..6dcb161f 100644 --- a/recovery_ui/screen_ui.cpp +++ b/recovery_ui/screen_ui.cpp @@ -448,7 +448,9 @@ void ScreenRecoveryUI::draw_foreground_locked() { int frame_height = gr_get_height(frame); int frame_x = (ScreenWidth() - frame_width) / 2; int frame_y = GetAnimationBaseline(); - DrawSurface(frame, 0, 0, frame_width, frame_height, frame_x, frame_y); + if (frame_x >= 0 && frame_y >= 0 && (frame_x + frame_width) < ScreenWidth() && + (frame_y + frame_height) < ScreenHeight()) + DrawSurface(frame, 0, 0, frame_width, frame_height, frame_x, frame_y); } if (progressBarType != EMPTY) {