[FIX] UIHV: screenshot geometry 85/60685/3
authorAlexander Aksenov <a.aksenov@samsung.com>
Fri, 25 Dec 2015 13:04:24 +0000 (16:04 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Tue, 26 Apr 2016 13:56:11 +0000 (16:56 +0300)
Now for objects with negative coordinates only visible part
is stored.

Change-Id: I6d8689409e09be21293d0b51716c7df32c5dc455
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
ui_viewer/ui_viewer_screenshot.c

index 610bf08..60cc97d 100644 (file)
@@ -202,6 +202,13 @@ static int capture_object(char *screenshot_path, int width, int height,
                        goto finish;
                }
 
+               // remove invisible image parts
+               if (x < 0)
+                       x = 0;
+
+               if (y < 0)
+                       y = 0;
+
                // crop image
                for (j = 0; j < height; j++) {
                        for (i = 0; i < width * bytes_per_pixel; i++) {