Subject: Re: 29.0.50; Bounding box of image-crop is unnoticable in certain cases

From: Visuwesh <[email-masked]>
Date: Fri, 23 Sep 2022 13:04:55 +0530

[வியாழன் செப்டம்பர் 22, 2022] Visuwesh wrote:

> Attached patch is an attempt to make the bounding box of image-crop more
> noticeable.

Revised patch attached.  I decided to make the stroke colour red since
white was not exactly noticeable, and decreased the size of stroke width
since darkening makes the bounding box noticeable enough.

>From e2e5935e6ee26464f0a8473c7ead7f7dce5b4aae Mon Sep 17 00:00:00 2001
From: Visuwesh <[email-masked]>
Date: Thu, 22 Sep 2022 19:49:18 +0530
Subject: [PATCH] Make bounding box of 'image-crop' more noticeable

* lisp/image/image-crop.el (image-crop--crop-image-1): Darken the
selected region to make the bounding-box more noticable in images
which are mostly white.  (bug#58004)
---
 lisp/image/image-crop.el | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el
index 39c5757636..1058f11102 100644
--- a/lisp/image/image-crop.el
+++ b/lisp/image/image-crop.el
@@ -349,18 +349,10 @@ image-crop--crop-image-1
 		((memq (car event) '(mouse-1 drag-mouse-1))
 		 (setq state 'move-unclick
                        prompt (format "Click to move for %s" op)))))))))
-     do (svg-line svg (cl-getf area :left) (cl-getf area :top)
-		  (cl-getf area :right) (cl-getf area :top)
-		  :id "top-line" :stroke-color "white")
-     (svg-line svg (cl-getf area :left) (cl-getf area :bottom)
-	       (cl-getf area :right) (cl-getf area :bottom)
-	       :id "bottom-line" :stroke-color "white")
-     (svg-line svg (cl-getf area :left) (cl-getf area :top)
-	       (cl-getf area :left) (cl-getf area :bottom)
-	       :id "left-line" :stroke-color "white")
-     (svg-line svg (cl-getf area :right) (cl-getf area :top)
-	       (cl-getf area :right) (cl-getf area :bottom)
-	       :id "right-line" :stroke-color "white")
+     do (svg-rectangle svg (cl-getf area :left) (cl-getf area :top)
+                       (image-crop--width area) (image-crop--height area)
+                       :stroke-color "red" :stroke-width 2
+                       :fill-opacity 0.3 :fill "black" :id "rect")
      while (not (member event '(return ?q)))
      finally (return (and (eq event 'return)
 			  area)))))
-- 
2.35.1