raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=d23615046b92333d7f27f97c040a6666a65a7aa3

commit d23615046b92333d7f27f97c040a6666a65a7aa3
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Jan 5 12:56:36 2020 +0000

    shot - fix crop out of bounds issue
---
 src/modules/shot/e_mod_edit.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/modules/shot/e_mod_edit.c b/src/modules/shot/e_mod_edit.c
index fc47155ce..a7d7bff6b 100644
--- a/src/modules/shot/e_mod_edit.c
+++ b/src/modules/shot/e_mod_edit.c
@@ -1269,7 +1269,6 @@ crop_update(void)
 static void
 crop_eval(int x1, int y1, int x2, int y2)
 {
-   printf("crop eval %i %i -> %i %i \n", x1, y1, x2, y2);
    if (x1 < x2)
      {
         crop_area.x = x1;
@@ -1290,8 +1289,13 @@ crop_eval(int x1, int y1, int x2, int y2)
         crop_area.y = y2;
         crop_area.h = y1 - y2 + 1;
      }
+   E_RECTS_CLIP_TO_RECT(crop_area.x, crop_area.y,
+                        crop_area.w, crop_area.h,
+                        0, 0, img_w, img_h);
    if (crop_area.w < 1) crop_area.w = 1;
    if (crop_area.h < 1) crop_area.h = 1;
+   if (crop_area.x >= img_w) crop_area.x = img_w - 1;
+   if (crop_area.y >= img_h) crop_area.y = img_h - 1;
    crop_export();
    crop_update();
 }

-- 


Reply via email to